public void Insert() { var db = new RealDB(connString, new SQL2005DBAnalyzer(connString)); var contents = db.ReadAll<Person>(); var person = new Person(); person.FirstName = "test"; person.LastName = "person"; db.Insert("Person", person._AsDictionary()); Assert.AreEqual(contents.Count() + 1, db.ReadAll<Person>().Count()); }
public void ReadAll() { var db = new RealDB(connString, new SQL2005DBAnalyzer(connString)); var results = db.ReadAll<Person>(); int actualCount = int.MinValue; using (var conn = new SqlConnection(connString)) { actualCount = conn.ExecuteSingleValue<int>("select count(*) from Person"); } Assert.AreEqual(results.Count(), actualCount); }