public static void Equals___Should_return_true___When_parameters_are_equal_and_have_different_versions() { // Arrange var systemUnderTest = new VersionlessTypeEqualityComparer(); var oldConditionsAssembly = TypeGenerator.LoadOlderVersionOfConditions(); var type1 = typeof(Conditions.Condition); var type2 = oldConditionsAssembly.GetTypes().Single(_ => _.Name == "Condition"); // Act var actual = systemUnderTest.Equals(type1, type2); // Assert actual.AsTest().Must().BeTrue(); }
public static void GetHashCode___Should_return_the_same_hash_code_for_representations_that_are_equal___When_called() { // Arrange var systemUnderTest = new VersionlessTypeEqualityComparer(); var oldConditionsAssembly = TypeGenerator.LoadOlderVersionOfConditions(); var types = new[] { typeof(Conditions.Condition), oldConditionsAssembly.GetTypes().Single(_ => _.Name == "Condition"), }; // Act var actual = types.Select(_ => systemUnderTest.GetHashCode(_)).ToList(); // Assert actual.Distinct().AsTest().Must().HaveCount(1); }