Beispiel #1
0
        public void ChangesCanBeCanceledWhenNulled()
        {
            var foo = new Whole
            {
                Part = new Part { Name = "part1" },
                Parts = new List<Part> { new Part { Name = "part2" }, new Part { Name = "part3" } }
            };

            var clone = foo.Clone(true);

            foo.BeginEdit();
            foo.Part = null;
            foo.Parts = null;
            Assert.IsFalse(foo.EqualsByValue(clone));
            foo.CancelEdit();

            Assert.IsTrue(foo.EqualsByValue(clone));
        }
Beispiel #2
0
        public void ComplexMixinsCanMap()
        {
            var source = new Whole
            {
                Part = new Part { Name = "part1" },
                Parts = new List<Part> { new Part { Name = "part2" }, new Part { Name = "part3" } }
            };

            var destination = new Whole();
            source.MapTo(destination);
            Assert.IsTrue(source.EqualsByValue(destination));
        }