public void AliasToBeanConstructorResultTransformerIsSerializable() { TestsContext.AssumeSystemTypeIsSerializable(); var rt = new AliasToBeanConstructorResultTransformer(typeof(StudentDTO).GetConstructor(System.Type.EmptyTypes)); NHAssert.IsSerializable(rt); }
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 void AliasToBeanConstructorResultTransformer_ShouldHaveEqualityBasedOnCtorParameter() { var emptyCtor = System.Type.EmptyTypes; var transformer1 = new AliasToBeanConstructorResultTransformer(typeof(object).GetConstructor(emptyCtor)); var transformer2 = new AliasToBeanConstructorResultTransformer(typeof(object).GetConstructor(emptyCtor)); Assert.That(transformer1, Is.EqualTo(transformer2)); Assert.That(transformer1.GetHashCode(), Is.EqualTo(transformer2.GetHashCode())); var transformer3 = new AliasToBeanConstructorResultTransformer(typeof(ImplementationOfEqualityTests).GetConstructor(emptyCtor)); Assert.That(transformer1, Is.Not.EqualTo(transformer3)); Assert.That(transformer1.GetHashCode(), Is.Not.EqualTo(transformer3.GetHashCode())); }
public void ResultTransformes() { IResultTransformer rt = new RootEntityResultTransformer(); NHAssert.IsSerializable(rt); rt = new AliasToBeanConstructorResultTransformer(typeof(StudentDTO).GetConstructor(System.Type.EmptyTypes)); NHAssert.IsSerializable(rt); rt = new AliasToBeanResultTransformer(typeof(StudentDTO)); NHAssert.IsSerializable(rt); rt = new DistinctRootEntityResultTransformer(); NHAssert.IsSerializable(rt); rt = new PassThroughResultTransformer(); NHAssert.IsSerializable(rt); }