예제 #1
0
        public void DetailedCompareTest()
        {
            var modeOrig = new TestA()
            {
                Id = 1, Name = "BB"
            };
            var modeEdit = modeOrig.DeepCopy();

            modeEdit.Id   = 2;
            modeEdit.Name = "xyz";

            var actual = modeOrig.DetailedCompare(modeEdit);

            actual.Should().BeEquivalentTo("1 ➜ 2<BR/>BB ➜ xyz");

            var actual2 = modeOrig.DetailedCompare(modeEdit, nameof(TestA.Id));

            actual2.Should().BeEquivalentTo("BB ➜ xyz");
        }
예제 #2
0
        public void DetailedCompareWithTitleTest()
        {
            var modeOrig = new TestA()
            {
                Id = 1, Name = "BB"
            };
            var modeEdit = modeOrig.DeepCopy();

            modeEdit.Id   = 2;
            modeEdit.Name = "xyz";
            var master = "Title";

            var actual = modeOrig.DetailedCompareWithTitle(modeEdit, master);

            actual.Should().BeEquivalentTo("Title<BR/>1 ➜ 2<BR/>BB ➜ xyz");

            var actual1 = modeOrig.DetailedCompareWithTitle(modeEdit, master, nameof(TestA.Name));

            actual1.Should().BeEquivalentTo("Title<BR/>1 ➜ 2");
        }