ECO, should we mock it?
I watched a video on Rhino Mocks yesterday. What a great framework! Obviously I wanted to know if I could use this with ECO so I thought I'd give it a try. In my website's AccountController there is a method like so public void AttemptLogin(string emailAddress, string password, string redirectUrl) { } Now I could just go ahead and write some OCL to find the user, but instead of doing this I really want to separate the code a bit. So I created a class public class UserRepository { private readonly IEcoServiceProvider ServiceProvider; public UserRepository(IEcoServiceProvider serviceProvider) { ServiceProvider = serviceProvider; } public User GetByEmailAddressAndPassword(string emailAddress, string password) { string searchEmail = BusinessClassesHelper.EscapeOcl(emailAddress); string criteria = string.Format("->select(emailAddress.sqlLikeCaseInsensitive('{0}'))", searchEmail); return BusinessClassesHelper.SelectFirstObject<Us