Пример #1
0
        public static void Implicit_conversion___Should_return_same_int_value_passed_to_constructor___When_converting_to_object_of_type_int()
        {
            // Arrange
            var expectedDouble  = (PercentChangeAsDouble.MinPercentChange + PercentChangeAsDouble.MaxPercentChange) / 2d;
            var systemUnderTest = new PercentChangeAsDouble(expectedDouble);

            // Act
            double actualDouble = systemUnderTest;

            // Assert
            actualDouble.Should().Be(expectedDouble);
        }
Пример #2
0
        public static void Cast___Should_return_the_same_value_passed_to_constructor___When_casting_to_double()
        {
            // Arrange
            var expectedDouble  = (PercentChangeAsDouble.MinPercentChange + PercentChangeAsDouble.MaxPercentChange) / 2d;
            var systemUnderTest = new PercentChangeAsDouble(expectedDouble);

            // Act
            var actualDouble = (double)systemUnderTest;

            // Assert
            actualDouble.Should().Be(expectedDouble);
        }