public void GetCustomerByIdTest() { _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer)); var tempCutomer = new Customer { id=16,name = "永京" }; _sample.CreateCustomer(tempCutomer); Customer customer = _sample.GetCustomerById(1); int customerId = customer.id; Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(1, customerId); }
public void insertCustomer() { _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer)); var tempCutomer = new Customer { id = 36, name = "永京", password = "******" }; _sample.CreateCustomer(tempCutomer); Customer cm = _sample.GetCustomerById(36); string name = cm.name; string password = cm.password; Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("永京", name); Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual("minjie", password); }
public void GetCustomerByIdTest() { _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer)); //this will be delete at the deleteC method in the end //so that it will success the next time run this whole TEST var tempCutomer = new Customer { id=16,name = "永京" }; _sample.CreateCustomer(tempCutomer); Customer customer = _sample.GetCustomerById(1); int customerId = customer.id; Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(1, customerId); }
public void GetCustomerByIdTest() { _sample = new NHibernateSample.Data.NHibernateSample(typeof(Customer)); var tempCutomer = new Customer { id = 16, name = "永京" }; _sample.CreateCustomer(tempCutomer); Customer customer = _sample.GetCustomerById(1); int customerId = customer.id; Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(1, customerId); }