Beispiel #1
0
        public PollsServiceTests(ContextFixture contextFixture, DbSetFixture dbSetFixture, RepositoryFixture repositoryFixture)
        {
            _contextFixture = contextFixture;
            _dbSetFixture   = dbSetFixture;

            var data        = new TestData().GetPollsData();
            var mockSet     = _dbSetFixture.CreateMockSet <Poll>(data);
            var mockContext = _contextFixture.CreateMockContext <Poll>(mockSet).Object;

            _repositoryMock = repositoryFixture.CreateRepository <PollsRepository, Poll>(mockContext);

            var answersData    = new TestData().GetUserPollAnswers();
            var answersSet     = _dbSetFixture.CreateMockSet <UserPollAnswer>(answersData);
            var answersContext = _contextFixture.CreateMockContext <UserPollAnswer>(answersSet).Object;

            _answersRepository = repositoryFixture.CreateRepository <UserPollAnswersRepository, UserPollAnswer>(answersContext);
        }
Beispiel #2
0
 public PollsController(IPollsRepository pollsRepository, IMapper mapper)
 {
     _pollsRepository = pollsRepository;
     _mapper          = mapper;
 }