public static void GetHashCode___Should_return_the_same_hash_code_for_null___When_called() { // Arrange var systemUnderTest = new VersionlessTypeEqualityComparer(); var expected = systemUnderTest.GetHashCode(null); // Act var actual = systemUnderTest.GetHashCode(null); // Assert actual.AsTest().Must().BeEqualTo(expected); }
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); }