public BetController(SportBetsContext context, IBetFinder finder, IUnitOfWork unitOfWork, IRepository <Bet> repository, IBetService betService) { _context = context; _finder = finder; _unitOfWork = unitOfWork; _repository = repository; _betService = betService; }
public void FindAllBets() { //initiallizing var context = DbContextMockFactory.Create <SportBetsContext>(); _list.Add(_bet); var set = context.MockSetFor <Bet>(_list); _betFinder = new BetFinder(set.Object.Bets); //act _betFinder.FindAllBets(); }
public void FindById() { //intiallizing var context = DbContextMockFactory.Create <SportBetsContext>(); _list.Add(_bet); var mockedSet = context.MockSetFor <Bet>(_list); _betFinder = new BetFinder(mockedSet.Object.Bets); //act var result = _betFinder.FindBetsById(_bet.Id); //assert Assert.Equal(_bet.Id, result.First().Id); }
public BetService(IUnitOfWork unitOfWork, IBetFinder betFinder, IRepository <Bet> betRepository) { _unitOfWork = unitOfWork; _betFinder = betFinder; _betRepository = betRepository; }