Example #1
0
        public void IEnumerableNamedGraphTest()
        {
            B newB = new B();

            a.BSet.Add(newB);
            EntityGraph eg = a.EntityGraph(EntityGraphs.CircularGraphShape1);

            Assert.AreEqual(a, eg.OfType <A>().Single());
            Assert.AreEqual(b, eg.OfType <B>().Single());
            Assert.AreEqual(c, eg.OfType <C>().Single());
            Assert.AreEqual(d, eg.OfType <D>().Single());

            Assert.IsTrue(eg.Count() == 4);
        }
Example #2
0
        public void IEnumerableTest()
        {
            B newB = new B();

            a.BSet.Add(newB);
            EntityGraph eg = a.EntityGraph(EntityGraphs.CircularGraphFull);

            Assert.AreEqual(a, eg.OfType <A>().Single());
            Assert.AreEqual(c, eg.OfType <C>().Single());
            Assert.AreEqual(d, eg.OfType <D>().Single());

            Assert.IsTrue(eg.OfType <B>().Contains(b));
            Assert.IsTrue(eg.OfType <B>().Contains(newB));

            Assert.IsTrue(eg.Count() == 5);
        }