Ejemplo n.º 1
0
        public async Task TestAppendTorqueWrenchWithExistProduct()
        {
            ITorqueWrenchRepository rp = new TorqueWrenchRepository();

            TorqueWrenchProduct product  = await new TorqueWrenchProductRepository().Find(1);
            Customer            customer = await new CustomerRepository().Find(1016);

            TorqueWrench wrench = new TorqueWrench {
                ManufactureDate = DateTime.Now, Product = product, Owner = customer, SerialNumber = "1234567"
            };

            var result = await rp.Add(wrench);

            wrench.Dump();
            Assert.IsTrue(result);
        }
Ejemplo n.º 2
0
        public async Task TestAppendTorqueWrench()
        {
            ITorqueWrenchRepository rp      = new TorqueWrenchRepository();
            TorqueWrenchProduct     product = new TorqueWrenchProduct {
                Manufacturer = "manfucv", Model = "model3", Name = "tname2", MinRange = 200, MaxRange = 2000, WorkDirection = WorkDirection.Bidirectional
            };
            Customer customer = new Customer {
                Address = "address3", Name = "cmpname2", ContactPhone = "123213"
            };

            customer.Contacts.Add(new CustomerContact {
                Company = customer, FirstName = "tom2", LastName = "cluse2", Mobile = "654255"
            });

            TorqueWrench wrench = new TorqueWrench {
                ManufactureDate = DateTime.Now, Product = product, Owner = customer, SerialNumber = "vbn-098"
            };

            var result = await rp.Add(wrench);

            wrench.Dump();
            Assert.IsTrue(result);
        }