Beispiel #1
0
        public void GetProfessorById_Should_Be_Null()
        {
            var repository = new Mock <IProfessorsRepository>();

            repository.Setup(x => x.GetAll()).Returns(professors);

            var professor = new ProfessorsService(repository.Object).GetByIdProfessor(22);

            Assert.Null(professor);
        }
Beispiel #2
0
        public void GetProfessors_Should_Equal_To_Two()
        {
            var repository = new Mock <IProfessorsRepository>();

            repository.Setup(x => x.GetAll()).Returns(professors);

            var listProfessors = new ProfessorsService(repository.Object).GetProfessors();

            Assert.Equal(listProfessors.Count, 2);
        }