Example #1
0
        public void CreateFaculty_PassCorrectName()
        {
            var facultyDTO = new FacultyDTO {
                Id = 7, Title = "Pravo5"
            };

            //Arrange
            using var context = new ApplicationDbContext(options);

            context.SaveChanges();
            var unitOfWork = new EFUnitOfWork(context);

            FacultyService facultyService = new FacultyService(unitOfWork, _mapper_2, _logger.Object);

            //Act
            facultyService.CreateFaculty(facultyDTO);

            //Assert
            Assert.Equal(7, unitOfWork.Faculties.Find(a => a.Title == "Pravo5").Select(i => i.Id).First());
        }