public static void Implicit_conversion___Should_return_same_int_value_passed_to_constructor___When_converting_to_object_of_type_int() { // Arrange var expectedInt = ThreadSafeRandom.Next(1, int.MaxValue); var systemUnderTest = new PositiveInteger(expectedInt); // Act int actualInt = systemUnderTest; // Assert actualInt.Should().Be(expectedInt); }
public static void Cast___Should_return_the_same_value_passed_to_constructor___When_casting_to_int() { // Arrange var expectedInt = ThreadSafeRandom.Next(1, int.MaxValue); var systemUnderTest = new PositiveInteger(expectedInt); // Act var actualInt = (int)systemUnderTest; // Assert actualInt.Should().Be(expectedInt); }
public bool Equals(PositiveInteger other) { return(Value == other.Value); }