Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public TorrentsController(IMapper mapper, ITorrentsService torrentsViewModelService) : base(mapper)
 {
     _torrentsService = torrentsViewModelService;
 }