public static void Implicit_conversion___Should_return_same_int_value_passed_to_constructor___When_converting_to_object_of_type_int() { // Arrange var expectedDouble = -1d * Math.Abs(ThreadSafeRandom.NextDouble()); var systemUnderTest = new NegativeDouble(expectedDouble); // Act double actualDouble = systemUnderTest; // Assert actualDouble.Should().Be(expectedDouble); }
public static void Cast___Should_return_the_same_value_passed_to_constructor___When_casting_to_int() { // Arrange var expectedDouble = -1d * Math.Abs(ThreadSafeRandom.NextDouble()); var systemUnderTest = new NegativeDouble(expectedDouble); // Act var actualDouble = (double)systemUnderTest; // Assert actualDouble.Should().Be(expectedDouble); }