public TorrentsServiceTests() { var options = new DbContextOptionsBuilder <TorrentsContext>().Options; var catalogContextMock = new DbContextMock <TorrentsContext>(options); catalogContextMock.CreateDbSetMock(x => x.Forums, InitialEntities.Forums); catalogContextMock.CreateDbSetMock(x => x.Torrents, InitialEntities.Torrents); catalogContextMock.CreateDbSetMock(x => x.Files, InitialEntities.Files); var torrentsRepository = new TorrentsRepository(catalogContextMock.Object); _torrentsService = new TorrentsService(torrentsRepository); }
public TorrentsController(IMapper mapper, ITorrentsService torrentsViewModelService) : base(mapper) { _torrentsService = torrentsViewModelService; }