コード例 #1
0
        public void TestContainsObject()
        {
            Product toaster = new Product {Name = "toaster"};
            Shop shop = new Shop {Products = {toaster}};

            ObjectGraph graph = new ObjectGraph(shop);
            Assert.IsTrue(graph.ContainsNode(toaster));
        }
コード例 #2
0
        public void TestDoesNotContainObject()
        {
            Product kettle = new Product { Name = "kettle" };
            Product toaster = new Product { Name = "toaster" };
            Shop shop = new Shop {Products = {kettle}};

            ObjectGraph graph = new ObjectGraph(shop);
            Assert.IsFalse(graph.ContainsNode(toaster));
        }