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 virtual void changerole(Customer cm ,string brole) { cm.role=brole; Session.Save(cm); Session.Flush(); }
public virtual void changepassword(Customer cm ,string bpass) { cm.password = bpass; Session.Save(cm); Session.Flush(); }
public void changename(Customer cm, string bname) { cm.name = bname; Session.Save(cm); Session.Flush(); }
public void delete(Customer cm) { Session.Delete(cm); Session.Flush(); }
public void CreateCustomer(Customer customer) { Session.Save(customer); Session.Flush(); }