public void QueryListTest() { string _sql = @"SELECT p.* FROM dbo.Person p WHERE p.Age > @Age;"; Assert.IsNotNull(sqlHelper.QueryList <Person>(_sql, new { Age = 1 })); Assert.IsNotNull(sqlHelper.QueryList <Person>(_sql, new Person { Age = 1 })); _sql = @"SELECT p.* FROM dbo.Person p WHERE p.Age = 1;"; Assert.IsNotNull(sqlHelper.QueryList <Person>(_sql)); }
public void QueryListTest() { List <Person> _personList = sqlHelper.QueryList <Person>("SELECT [id],[username],[password],[age],[registerDate],[address] FROM [Person]", null); Assert.IsNotNull(_personList); }