public void GetComplexObject()
 {
     NodeMapper nodeMapper = new NodeMapper();
     Order order= nodeMapper.Get<Order>(14);
     Assert.AreEqual(14, order.Id);
     Assert.AreEqual(2, order.OrderItems.Count);
 }
        public void GetComplexObject()
        {
            NodeMapper nodeMapper = new NodeMapper();
            Order      order      = nodeMapper.Get <Order>(14);

            Assert.AreEqual(14, order.Id);
            Assert.AreEqual(2, order.OrderItems.Count);
        }
Exemplo n.º 3
0
        public void GetEntityTest()
        {
            NodeMapper mapper = new NodeMapper();
            Person     person = mapper.Get <Person>(7);

            Console.WriteLine("Generated Id: " + person.Id.ToString());
            Assert.AreNotEqual(0, person.Id);
            Assert.AreEqual("Sony", person.FirstName);
        }
Exemplo n.º 4
0
        public void Get_MyClassEntity_And_Update_Manager()
        {
            NodeMapper nodeMapper = new NodeMapper();
            MyClass    myClaz     = nodeMapper.Get <MyClass>(29);

            Console.WriteLine("Get_MyClassEntity_And_Update_Manager: " + myClaz.GetType().ToString());
            Manager manager = (Manager)myClaz.SelectedPerson;

            manager.OfficeName    = "Product Development";
            myClaz.SelectedPerson = manager;
            nodeMapper.Save <MyClass>(myClaz);


            MyClass myClazTmp  = nodeMapper.Get <MyClass>(29);
            Manager managerTmp = (Manager)myClaz.SelectedPerson;

            Assert.AreEqual("Product Development", manager.OfficeName);
        }
Exemplo n.º 5
0
        public void DeleteEntityTest()
        {
            Person     person = this.SaveTest();
            NodeMapper mapper = new NodeMapper();

            mapper.Delete <Person>(person);

            Person tryGetDeletedPerson = mapper.Get <Person>(person.Id);

            Assert.AreEqual(person.Id, tryGetDeletedPerson.Id);
        }
Exemplo n.º 6
0
        public void Get_MyClassEntity_With_Manager()
        {
            NodeMapper nodeMapper = new NodeMapper();
            MyClass    myClaz     = nodeMapper.Get <MyClass>(29);
            Manager    manager    = (Manager)myClaz.SelectedPerson;

            Assert.IsNotNull(myClaz);
            Assert.IsNotNull(manager);
            Assert.AreEqual(29, myClaz.Id);
            Assert.AreEqual("Neo4jD", manager.OfficeName);
        }
 public void GetOrder()
 {
     NodeMapper nodeMapper = new NodeMapper();
     Order order = nodeMapper.Get<Order>(19);
     Assert.AreEqual(14, order.Id);
     foreach (OrderItem item in order.OrderItems)
     {
         Console.WriteLine(item.Id.ToString());
         Product prod = item.Product;
         if (prod != null)
             Console.WriteLine(prod.ProductName);
     }
     Assert.AreEqual(2, order.OrderItems.Count);
 }
        public void GetOrder()
        {
            NodeMapper nodeMapper = new NodeMapper();
            Order      order      = nodeMapper.Get <Order>(19);

            Assert.AreEqual(14, order.Id);
            foreach (OrderItem item in order.OrderItems)
            {
                Console.WriteLine(item.Id.ToString());
                Product prod = item.Product;
                if (prod != null)
                {
                    Console.WriteLine(prod.ProductName);
                }
            }
            Assert.AreEqual(2, order.OrderItems.Count);
        }
Exemplo n.º 9
0
 public void CanReadNodeToDifferentEntity()
 {
     NodeMapper mapper  = new NodeMapper();
     Address    address = mapper.Get <Address>(7);
 }
Exemplo n.º 10
0
 public void GetEntityTest()
 {
     NodeMapper mapper = new NodeMapper();
     Person person = mapper.Get<Person>(7);
     Console.WriteLine("Generated Id: " + person.Id.ToString());
     Assert.AreNotEqual(0, person.Id);
     Assert.AreEqual("Sony", person.FirstName);
 }
Exemplo n.º 11
0
        public void DeleteEntityTest()
        {
            Person person = this.SaveTest();
            NodeMapper mapper = new NodeMapper();
            mapper.Delete<Person>(person);

            Person tryGetDeletedPerson = mapper.Get<Person>(person.Id);
            Assert.AreEqual(person.Id, tryGetDeletedPerson.Id);
        }
Exemplo n.º 12
0
 public void CanReadNodeToDifferentEntity()
 {
     NodeMapper mapper = new NodeMapper();
     Address address = mapper.Get<Address>(7);
 }