public async Task TestUpdate() { TorqueWrenchMeasureRepository rp = new TorqueWrenchMeasureRepository(); var test = await rp.Find(1); // test.Dump(); // test.Measurand = await new TorqueWrenchRepository().Find(5); TorqueWrenchProduct product = await new TorqueWrenchProductRepository().Find(7); // product = new TorqueWrenchProduct { Manufacturer = "ddd", Model = "3434", Name = "dsdsd" }; Customer customer = await new CustomerRepository().Find(5); test.Measurand = new TorqueWrench { ManufactureDate = DateTime.Now, Product = product, Owner = customer, SerialNumber = "bnmb" }; test.TestCode = "123"; test.Data.ZeroPoint = 121; test.Data.GagingPoints[0].Nominal = 111; test.Data.GagingPoints[1].Values[1] = 111; test.Environment = await EnvironmentRepository.Find(2); // test.Environment = new Environment { Time = DateTime.Now, Address = "abcded", Humidity = 12, Temperature =64 }; var result = await rp.Update(test); // test.Dump(); Assert.IsTrue(result); }
public async Task TestTimestamp() { ITorqueWrenchMeasureRepository rp = new TorqueWrenchMeasureRepository(); var test = await rp.Find(5); if (test != null) { test.Dump(); } Assert.IsTrue(test != null); test.TestCode = "xxx"; await rp.Update(test); var result = await rp.Update(test); Assert.IsTrue(result); }