示例#1
0
        public void AsMoney_WhenValueIsOverAMillionAndMoreDecimalPlaces_ThenCommasAreInserted()
        {
            // Arrange
            decimal input = 12345678.1234M;

            // Act
            string output = ExtensionMethods.AsFormattedMoney(input);

            // Assert
            output.Should().Be("£12,345,678.12");
        }
示例#2
0
        public void AsMoney_WhenValueIsZero_ThenOutputIsCorrect()
        {
            // Arrange
            decimal input = 0M;

            // Act
            string output = ExtensionMethods.AsFormattedMoney(input);

            // Assert
            output.Should().Be("£0");
        }
示例#3
0
        public void AsMoney_WhenValueIsOverAThousand_ThenCommasAreInserted()
        {
            // Arrange
            decimal input = 10050M;

            // Act
            string output = ExtensionMethods.AsFormattedMoney(input);

            // Assert
            output.Should().Be("£10,050");
        }