public void UintVersion_SecondVersionEqualFirstTestCase() { const int expectedValue = 0; UintVersion v1 = null; UintVersion v2 = null; Given("Create first version.", () => v1 = new UintVersion(2)) .And("Create second version.", _ => v2 = new UintVersion(2)) .When("Compare version.", _ => v2.CompareTo(v1)) .ThenAreEqual(expectedValue) .Run(); }
public void UintVersionVersionNotLessThanDateTimeTestCase() { const string expectedReason = "Unable to compare versions UintVersion and Version2020."; UintVersion v1 = null; Version2020 v2 = null; Given("Create first version.", () => v1 = new UintVersion(1)) .And("Create second version.", _ => v2 = new Version2020()) .When("Compare version.", _ => ExpectedFactFactoryException(() => v1.CompareTo(v2))) .ThenAssertErrorDetail(ErrorCode.InvalidFactType, expectedReason) .Run(); }
public void UintVersion_FirstVersionLessThanSecondTestCase() { const int expectedValue = -1; UintVersion v1 = null; UintVersion v2 = null; Given("Create first version.", () => v1 = new UintVersion(1)) .And("Create second version.", _ => v2 = new UintVersion(2)) .When("Compare version.", _ => v1.CompareTo(v2)) .ThenAreEqual(expectedValue) .Run(); }