Ejemplo n.º 1
0
        public void FullEntityGraphShapeTestCollectionAssociations()
        {
            A a = new A {
                B = new B()
            };

            a.B.Cs = new List <C>()
            {
                new C()
            };

            var shape = new FullEntityGraphShape();

            var outedges = shape.OutEdges(a.B);

            Assert.IsTrue(outedges.Count() == 2);

            var collection = outedges.Single(x => x.Name == "Cs");

            Assert.IsTrue(collection == typeof(B).GetProperty("Cs"));

            var graph = new EntityGraph <object>(a, shape);

            Assert.IsTrue(graph.Count() == 3);
        }
Ejemplo n.º 2
0
        public void FullEntityGraphShapeTestMultiAssociations()
        {
            B   b        = new B();
            var shape    = new FullEntityGraphShape();
            var outedges = shape.OutEdges(b);

            Assert.IsTrue(outedges.Count() == 2);
        }
Ejemplo n.º 3
0
        public void FullEntityGraphShapeTestSingleAssociations()
        {
            A a = new A {
                B = new B()
            };

            var shape = new FullEntityGraphShape();

            var outedges = shape.OutEdges(a);

            Assert.IsTrue(outedges.Count() == 1);
            Assert.IsTrue(outedges.Single() == typeof(A).GetProperty("B"));

            var graph = new EntityGraph <object>(a, shape);

            Assert.IsTrue(graph.Count() == 2);
        }