示例#1
0
        public async Task Create_ShouldReturnInstanceOfProfessorDetailsDto()
        {
            // Arrange
            _mockProfessorMapper.Setup(mapper => mapper.Map(_professor1)).Returns(_professorDetailsDto1);
            _mockProfessorMapper.Setup(mapper => mapper.Map(_professorCreatingDto)).Returns(_professor1);
            _mockWriteRepository.Setup(repo => repo.AddNewAsync <Professor>(_professor1)).Returns(() => Task.FromResult(_professor1));
            // Act
            ProfessorDetailsDto actualProfessor = await _professorService.Create(_professorCreatingDto);

            // Assert
            actualProfessor.Should().BeEquivalentTo(_professorDetailsDto1);
        }