コード例 #1
0
        public void Not_Equal_When_GnMomH_Is_Different()
        {
            var x = new GenericComposition
            {
                GnMomH = 1,
                GnMwHs = SubstanceIndication.H,
                GnNkPk = 2,
                GsKode = 3,
                MutKod = MutKod.RecordUpdated,
                XnMomE = 4,
                XpEhHv = 5
            };
            var y = new GenericComposition
            {
                GnMomH = 2,
                GnMwHs = SubstanceIndication.H,
                GnNkPk = 2,
                GsKode = 3,
                MutKod = MutKod.RecordUpdated,
                XnMomE = 4,
                XpEhHv = 5
            };

            var comparer = new GenericCompositionComparer();
            bool result = comparer.Equals(x, y);
            Assert.IsFalse(result);
        }
コード例 #2
0
        public void Equal_When_All_Fields_Are_Equal()
        {
            var x = new GenericComposition
            {
                GnMomH = 1,
                GnMwHs = SubstanceIndication.H,
                GnNkPk = 2,
                GsKode = 3,
                MutKod = MutKod.RecordUpdated,
                XnMomE = 4,
                XpEhHv = 5

            };
            var y = new GenericComposition
            {
                GnMomH = 1,
                GnMwHs = SubstanceIndication.H,
                GnNkPk = 2,
                GsKode = 3,
                MutKod = MutKod.RecordUpdated,
                XnMomE = 4,
                XpEhHv = 5
            };

            var comparer = new GenericCompositionComparer();
            bool result = comparer.Equals(x, y);
            Assert.IsTrue(result);
        }