コード例 #1
0
 public BetController(SportBetsContext context,
                      IBetFinder finder,
                      IUnitOfWork unitOfWork,
                      IRepository <Bet> repository,
                      IBetService betService)
 {
     _context    = context;
     _finder     = finder;
     _unitOfWork = unitOfWork;
     _repository = repository;
     _betService = betService;
 }
コード例 #2
0
        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();
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: BetService.cs プロジェクト: PurrfectME/Sp0rtBets
 public BetService(IUnitOfWork unitOfWork, IBetFinder betFinder, IRepository <Bet> betRepository)
 {
     _unitOfWork    = unitOfWork;
     _betFinder     = betFinder;
     _betRepository = betRepository;
 }