Пример #1
0
        public void PassThroughAndRootEntityInequality()
        {
            var transf1 = new PassThroughResultTransformer();
            var transf2 = new RootEntityResultTransformer();

            Assert.IsFalse(transf1.Equals(transf2));
            Assert.IsFalse(transf2.Equals(transf1));
        }
Пример #2
0
        public void PassThroughEquality()
        {
            var transf1 = new PassThroughResultTransformer();
            var transf2 = new PassThroughResultTransformer();

            Assert.IsTrue(transf1.Equals(transf2));
            Assert.IsTrue(transf2.Equals(transf1));
        }
Пример #3
0
        public void ResultTransformesAreSerializable()
        {
            IResultTransformer rt = new RootEntityResultTransformer();

            NHAssert.IsSerializable(rt);

            rt = new DistinctRootEntityResultTransformer();
            NHAssert.IsSerializable(rt);

            rt = new PassThroughResultTransformer();
            NHAssert.IsSerializable(rt);
        }
        public void PassThroughEquality()
        {
            var transf1 = new PassThroughResultTransformer();
            var transf2 = new PassThroughResultTransformer();
            HashSet <IResultTransformer> set = new HashSet <IResultTransformer>()
            {
                transf1, transf2,
            };

            Assert.That(set.Count, Is.EqualTo(1));
            Assert.IsTrue(transf1.Equals(transf2));
            Assert.IsTrue(transf2.Equals(transf1));
        }
        public void PassThroughAndRootEntityInequality()
        {
            var transf1 = new PassThroughResultTransformer();
            var transf2 = new CustomPassThroughResultTransformer();
            HashSet <IResultTransformer> set = new HashSet <IResultTransformer>()
            {
                transf1, transf2,
            };

            Assert.That(transf1.GetHashCode(), Is.EqualTo(transf2.GetHashCode()), "prerequisite");
            Assert.That(set.Count, Is.EqualTo(2));
            Assert.IsFalse(transf1.Equals(transf2));
            Assert.IsFalse(transf2.Equals(transf1));
        }
Пример #6
0
        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);
        }