Skip to content

Convert decimal strings with comma separator #6

Description

@pz1337

Expected behavior

The class SwapStringToBytes can convert strings declared as decimal with a comma as decimal separator to doubles. (See test code below.)
The class SwapStringToBytes has a test class SwapStringToBytesTests.
The class SwapStringToBytes is in the namespace PAQO.Core.Facets.
The class SwapBytesToString is in the namespace PAQO.Core.Facets.
The class SwapBytesToStringTests is in the namespace PAQO.Core.Facets.Test.

Actual behavior

The class SwapStringToBytes cannot convert strings declared as decimal with a comma as decimal separator to doubles.
The class SwapStringToBytes has no test class.
The namespaces are wrong.

Steps to reproduce the behavior

using PAQO.Core.Prop;
using Xunit;

namespace PAQO.Core.Facets.Test
{
    public sealed class SwapStringToBytesTests
    {
        [Fact]
        public void DeliversDoubleForCommaDecimalSeparator()
        {
            Assert.Equal(
                6083.15,
                new DecimalProp.AsDouble(
                    new SwapStringToBytes().Flip("decimal", "6083,15")
                ).Value()
            );
        }
    }
}

The log given by the failure.

Mention any other details that might be useful

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions