public void hashcode_logic() { var instance1 = new ConstructorInstance(typeof(IWidget), typeof(AWidget), ServiceLifetime.Transient) { Name = "One" }; var instance2 = new ConstructorInstance(typeof(IWidget), typeof(AWidget), ServiceLifetime.Transient) { Name = "Two" }; var instance3 = new ConstructorInstance(typeof(AWidget), typeof(AWidget), ServiceLifetime.Transient) { Name = "One" }; var instance4 = new ConstructorInstance(typeof(IWidget), typeof(AWidget), ServiceLifetime.Transient) { Name = "One" }; instance1.GetHashCode().ShouldBe(instance4.GetHashCode()); instance1.GetHashCode().ShouldNotBe(instance2.GetHashCode()); instance1.GetHashCode().ShouldNotBe(instance3.GetHashCode()); instance2.GetHashCode().ShouldNotBe(instance3.GetHashCode()); }