Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public void Repo_WithContext_BuildsCorrectly()
        {
            var repo = new EventParticipantsRepository(_contextFixture.CreateMockContext(_dbSetFixture.CreateMockSet(new List <EventParticipant>())).Object);

            Assert.NotNull(repo);
        }
Exemplo n.º 3
0
        public void Repo_WithContext_BuildsCorrectly()
        {
            var repo = new UserPollAnswersRepository(_contextFixture.CreateMockContext(_dbSetFixture.CreateMockSet(new List <UserPollAnswer>())).Object);

            Assert.NotNull(repo);
        }