Hi, I'm trying to get Figure 3 Fake Database from IRepository using the example here http://msdn.microsoft.com/en-us/magazine/dd263069.aspx
public class InMemoryRepository : IRepository
{
private readonly Cache<Type, object> _types;
private MockUnitOfWork _lastUnitOfWork;
public InMemoryRepository()
{
_types = new Cache<Type, object>(type =>
{
Type listType = typeof(List<>).MakeGenericType(type);
return Activator.CreateInstance(listType);
});
}
private IList<T> listFor<T>()
{
return (IList<T>)_types.Get(typeof(T));
}
public T Find<T>(long id) where T : Entity
{
return listFor<T>().FirstOrDefault(t => t.Id == id);
}
public void Delete<T>(T target)
{
listFor<T>().Remove(target);
}
public T[] Query<T>(Expression<Func<T, bool>> where)
{
var query = from item in listFor<T>() select item;
return query.Where(where.Compile()).ToArray();
}
public void Save<T>(T target)
{
listFor<T>().Add(target);
}
}
I'm getting 'Cannot resolve symbol MockUnitOfWork. I have NUnit/Moq/Rhino.Mock installed/referenced but I cannot find any reference to MockUnitOfWork. Any help appreciated.