code_junkie

How do I use IoC in a setup like this Is there a better way to test this

Nov 14th, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public interface IBlogRepository : IRepository
  2. {
  3. Post GetPostById(Guid postId);
  4. Post GetPostByFriendlyUrl(string friendlyUrl);
  5.  
  6. List<Post> GetPostsByAuthor(string userName);
  7. List<Post> GetPostByTags(params string[] tags);
  8. List<Author> Authors { get; }
  9.  
  10. void Delete(Post post);
  11. void Delete(Comment comment);
  12. void Save(Post post);
  13. void Save(Comment comment);
  14. }
  15.  
  16. public XmlBlogRepository(string dataPath, IFileReader fileReader, IDirectoryReader directoryReader, ILogger logger)
  17. {
  18. this.dataPath = dataPath;
  19. this.fileReader = fileReader;
  20. this.directoryReader = directoryReader;
  21. this.Logger = logger;
  22. }
Add Comment
Please, Sign In to add comment