I am starting with Dapper, the micro-ORM, and i use the Dapper Rainbow. I want to test the queries and the data retrieved by them.
I mean, for example, i have the UserService with the method GetAll(), and i want to test that the sql query is retrieving all the users from some List (not from the database because i want the tests to be fast). Do you know how can i do that?
My service class (and the method i want to test):
public static class UserService{
public static IEnumerable<User> GetAll(){
return DB.Users.All();
}
}
Do you have any advice about unit testing queries and data retrieving?
Thanks