Skip to content

Instantly share code, notes, and snippets.

@FraukeN
Created February 17, 2018 23:07
Show Gist options
  • Save FraukeN/3911cbaeed6755665056bac35b3e7e3f to your computer and use it in GitHub Desktop.
Save FraukeN/3911cbaeed6755665056bac35b3e7e3f to your computer and use it in GitHub Desktop.
Mock Repositlry 1
public class MockRepository : IRepository<ToDoItem>
{
private List<ToDoItem> _toDoItems { get; set; }
public MockRepository()
{
_toDoItems = new List<ToDoItem>();
_toDoItems.Add(new ToDoItem { Id = 1, Title = "Buy cat food", Description = "It's either that or be ambushed and gnawed" });
_toDoItems.Add(new ToDoItem { Id = 2, Title = "Starch underwear", Description = "It ain't safe if it don't chafe" });
_toDoItems.Add(new ToDoItem { Id = 3, Title = "Start retro girl band", Description = "Frauke and the courgettes" });
}
public Task<ToDoItem> GetAsync(int Id)
{
throw new NotImplementedException();
}
public async Task<IEnumerable<ToDoItem>> GetAsync()
{
return await Task.FromResult(_toDoItems);
}
public Task<IEnumerable<ToDoItem>> GetAsync(Expression<Func<ToDoItem, bool>> predicate)
{
throw new NotImplementedException();
}
public Task<IEnumerable<ToDoItem>> GetAsync(int skip, int take)
{
throw new NotImplementedException();
}
public Task<IEnumerable<ToDoItem>> GetAsync(Expression<Func<ToDoItem, bool>> predicate, int skip, int take)
{
throw new NotImplementedException();
}
public Task<ToDoItem> FindAsync(Expression<Func<ToDoItem, bool>> predicate)
{
throw new NotImplementedException();
}
public Task<int> AddAsync(ToDoItem entity)
{
throw new NotImplementedException();
}
public Task AddRangeAsync(IEnumerable<ToDoItem> entities)
{
throw new NotImplementedException();
}
public Task<bool> UpdateAsync(ToDoItem entity)
{
throw new NotImplementedException();
}
public Task DeleteAsync(ToDoItem entity)
{
throw new NotImplementedException();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment