public void UpdateTest() { //Arrange var db = new NovA("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\\TestDB.mdf';Integrated Security=True;Connect Timeout=30"); //Act var person = db.GetList <Person>().Find(x => x.FirstName == "Henry"); person.FirstName = "Hendrick"; db.UpdateWithValues <Person>(person); person = db.GetList <Person>().Find(x => x.FirstName == "Hendrick"); //Assert Assert.AreEqual(person.FirstName, "Hendrick"); }
public void GetListTest() { //Arrange var db = new NovA("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\\TestDB.mdf';Integrated Security=True;Connect Timeout=30"); //Act var people = db.GetList <Person>(); //Assert Assert.AreEqual(people.Count, 10); }
public void InsertTest() { //Arrange var db = new NovA("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\\TestDB.mdf';Integrated Security=True;Connect Timeout=30"); //Act var person = new Person() { FirstName = "Henry", LastName = "Franklin" }; db.InsertWithValues(person); var people = db.GetList <Person>(); //Assert Assert.AreEqual(people.Count, 11); }