public void AliasToBeanConstructorResultTransformer_ShouldHaveEqualityBasedOnCtorParameter() { var emptyCtor = new System.Type[0]; var transformer1 = new AliasToBeanConstructorResultTransformer(typeof(object).GetConstructor(emptyCtor)); var transformer2 = new AliasToBeanConstructorResultTransformer(typeof(object).GetConstructor(emptyCtor)); transformer1.Should().Be.EqualTo(transformer2); transformer1.GetHashCode().Should().Be.EqualTo(transformer2.GetHashCode()); var transformer3 = new AliasToBeanConstructorResultTransformer(typeof(ImplementationOfEqualityTests).GetConstructor(emptyCtor)); transformer1.Should().Not.Be.EqualTo(transformer3); transformer1.GetHashCode().Should().Not.Be.EqualTo(transformer3.GetHashCode()); }
public bool Equals(AliasToBeanConstructorResultTransformer other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return Equals(other.constructor, constructor); }
public bool Equals(AliasToBeanConstructorResultTransformer other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.constructor, constructor)); }
public void ResultTransformes() { IResultTransformer rt = new RootEntityResultTransformer(); NHAssert.IsSerializable(rt); rt = new AliasToBeanConstructorResultTransformer(typeof(StudentDTO).GetConstructor(new System.Type[] { })); NHAssert.IsSerializable(rt); rt = new AliasToBeanResultTransformer(typeof(StudentDTO)); NHAssert.IsSerializable(rt); rt = new DistinctRootEntityResultTransformer(); NHAssert.IsSerializable(rt); rt = new PassThroughResultTransformer(); NHAssert.IsSerializable(rt); }