コード例 #1
0
ファイル: CompositeTest.cs プロジェクト: jgwynn2901/composite
        public void TestCopyAndPreserve()
        {
            var ahs = new AhsSegment
            {
                AhsId        = "12",
                AhsType      = "RISK LOCATION",
                ActiveStatus = "DEACTIVATED",
                FullName     = "D. B. SWEENY"
            };

            var source = new AhsSegment
            {
                Address1     = "529 Main Street",
                Address2     = "Suite 6000",
                City         = "Charlestown",
                State        = "MA",
                ActiveStatus = "ACTIVE",
                FullName     = "D B SWEENEY"
            };

            ahs.CopyAndPreserve(source);

            Assert.IsTrue(ahs.AhsId == "12");
            Assert.IsTrue(ahs.Address1 == "529 Main Street");
            Assert.IsTrue(ahs.Address2 == "Suite 6000");
            Assert.IsTrue(ahs.City == "Charlestown");
            Assert.IsTrue(ahs.State == "MA");
            Assert.IsTrue(ahs.ActiveStatus == "ACTIVE");
            Console.WriteLine(ahs.FullName);
        }
コード例 #2
0
ファイル: CompositeTest.cs プロジェクト: jgwynn2901/composite
        /// <summary>
        /// Tests the compare to.
        /// </summary>
        [Test] public void TestCompareTo()
        {
            var original = new AhsSegment
            {
                AhsId        = "12345",
                UploadKey    = "TEST",
                FullName     = "TEST ACCOUNT",
                AhsType      = "ACCOUNT",
                ClientNodeId = "202"
            };
            var clone = (AhsSegment)original.Clone();

            Assert.IsTrue(original.CompareTo(clone) == 0, "Something failed!");
            clone.UploadKey = "TEST2";
            Assert.IsTrue(original.CompareTo(clone) < 0, "Something failed!");
            clone.UploadKey = "ABC";
            Assert.IsTrue(original.CompareTo(clone) > 0, "Something failed!");

            var clone2 = (AhsSegment)original.Clone();

            Assert.IsTrue(original == clone2, "Something failed!");
            clone2.UploadKey = "TEST2";
            Assert.IsTrue(original != clone2, "Something failed!");
        }