コード例 #1
0
        public async Task SaveAsyncWhenFacultiesReturnsSuccess()
        {
            var     mockFacultyRepository    = GetDefaultIFacultyRepositoryInstance();
            var     mockUniversityRepository = GetDefaultIUniversityRepositoryInstance();
            var     mockUnitOfWork           = GetDefaultIUnitOfWorkInstance();
            Faculty faculty = new Faculty();

            mockFacultyRepository.Setup(r => r.AddAsync(faculty))
            .Returns(Task.FromResult <Faculty>(faculty));
            var             service = new FacultyService(mockFacultyRepository.Object, mockUniversityRepository.Object, mockUnitOfWork.Object);
            FacultyResponse result  = await service.SaveAsync(faculty, 1);

            var message = result.Message;

            message.Should().Be("");
        }