public void CheckPersonWithIdGreaterThan2AndLessThan4() { List<IPerson> mockPersons = table.GetTable().Where(p => p.Id > 2 && p.Id < 4).ToList(); using (OracleConnection conn = new OracleConnection(OracleUtility.ConnectionString)) { conn.Open(); IList<Person> persons = conn.GetList<Person>("select Id,Name from person where Id > :from_id and Id < :to_id", new { from_id = 2, to_id = 4 }); } }
public void CheckPersonWithNameLikeM() { List<IPerson> mockPersons = table.GetTable().Where(p => p.Name.StartsWith("M")).ToList(); using (OracleConnection conn = new OracleConnection(OracleUtility.ConnectionString)) { conn.Open(); var persons = conn.GetList<Person>("select Id,Name from person where Name like 'M%'"); Assert.AreEqual(mockPersons.Count, persons.Count); for (int i = 0; mockPersons.Count > i; i++) { Assert.AreEqual(mockPersons[i].Id, persons[i].Id); Assert.AreEqual(mockPersons[i].Name, persons[i].Name); } } }
public void NullDOB() { using (OracleConnection conn = new OracleConnection(OracleUtility.ConnectionString)) { conn.Open(); Assert.DoesNotThrow(() => { conn.GetList<Person>("Select NULL as DateOfBirth From PERSON"); }); } }