Example #1
0
        public void TestStringMember()
        {
            var obj = new StringMember { Member = "a" };

            var container = new NodeContainer();
            var node = (GraphNode)container.GetOrCreateNode(obj);
            Assert.AreEqual(obj, node.Content.Value);
            Assert.AreEqual(1, node.Children.Count);
            Assert.AreEqual(nameof(StringMember.Member), node.Children.First().Name);
            Assert.AreEqual(obj.Member, node.Children.First().Content.Value);
            obj.Member = "b";
            Assert.AreEqual(obj.Member, node.Children.First().Content.Value);
            node.Children.First().Content.Update("c");
            Assert.AreEqual(obj.Member, node.Children.First().Content.Value);
        }
Example #2
0
        public void TestStringMember()
        {
            var obj = new StringMember {
                Member = "a"
            };

            var container = new NodeContainer();
            var node      = (GraphNode)container.GetOrCreateNode(obj);

            Assert.AreEqual(obj, node.Content.Value);
            Assert.AreEqual(1, node.Children.Count);
            Assert.AreEqual(nameof(StringMember.Member), node.Children.First().Name);
            Assert.AreEqual(obj.Member, node.Children.First().Content.Value);
            obj.Member = "b";
            Assert.AreEqual(obj.Member, node.Children.First().Content.Value);
            node.Children.First().Content.Update("c");
            Assert.AreEqual(obj.Member, node.Children.First().Content.Value);
        }
        public void TestStringMember()
        {
            var obj = new StringMember { Member = "aaa" };
            var container = new NodeContainer();

            // Construction
            var containerNode = (GraphNode)container.GetOrCreateNode(obj);
            Helper.TestNonCollectionObjectContentNode(containerNode, obj, 1);
            var memberNode = containerNode.Children.First();
            Helper.TestMemberContentNode(containerNode, memberNode, obj, obj.Member, nameof(StringMember.Member), false);

            // Update from object
            obj.Member = "bbb";
            Helper.TestMemberContentNode(containerNode, memberNode, obj, obj.Member, nameof(StringMember.Member), false);

            // Update from Quantum
            containerNode.Children.First().Content.Update("ccc");
            Helper.TestMemberContentNode(containerNode, memberNode, obj, obj.Member, nameof(StringMember.Member), false);
        }
Example #4
0
        public void TestStringMember()
        {
            var obj = new StringMember {
                Member = "aaa"
            };
            var container = new NodeContainer();

            // Construction
            var containerNode = container.GetOrCreateNode(obj);

            Helper.TestNonCollectionObjectNode(containerNode, obj, 1);
            var memberNode = containerNode.Members.First();

            Helper.TestMemberNode(containerNode, memberNode, obj, obj.Member, nameof(StringMember.Member), false);

            // Update from object
            obj.Member = "bbb";
            Helper.TestMemberNode(containerNode, memberNode, obj, obj.Member, nameof(StringMember.Member), false);

            // Update from Quantum
            containerNode.Members.First().Update("ccc");
            Helper.TestMemberNode(containerNode, memberNode, obj, obj.Member, nameof(StringMember.Member), false);
        }