Exemplo n.º 1
0
        public void Throw_ArgumentNullException_When_SessionTO_IsNULL()
        {
            MockSessionRepository.Setup(x => x.GetAll()).Returns(EmptySessionList);
            MockUofW.Setup(x => x.SessionRepository).Returns(MockSessionRepository.Object);

            var Assistante = new RSAssistantRole(MockUofW.Object);

            //ASSERT
            Assert.ThrowsException <ArgumentNullException>(() => Assistante.GetSessions());
        }
Exemplo n.º 2
0
        public void GetSessions_SessionRepositoryIsCalledOnce()
        {
            //ARRANGE
            MockSessionRepository.Setup(x => x.GetAll()).Returns(SessionList);
            MockUofW.Setup(x => x.SessionRepository).Returns(MockSessionRepository.Object);

            var ass = new RSAssistantRole(MockUofW.Object);

            //ACT
            var SessionsAll = ass.GetSessions();

            //ASSERT
            MockSessionRepository.Verify(x => x.GetAll(), Times.Once);
        }
Exemplo n.º 3
0
        public void GetSessions_ReturnsAllSessionsFromDB()
        {
            //ARRANGE
            MockSessionRepository.Setup(x => x.GetAll()).Returns(SessionList);
            MockUofW.Setup(x => x.SessionRepository).Returns(MockSessionRepository.Object);

            var ass = new RSAssistantRole(MockUofW.Object);

            //ACT
            var sessions = ass.GetSessions();

            //ASSERT
            Assert.AreEqual(SessionList().Count, sessions.Count);
            Assert.AreEqual(3, sessions.Count);
        }