public async Task CreateAsync_ReturnsCreatedAndStudentInfo() { Mock <IStudentRepository> studentRepositoryMock = new Mock <IStudentRepository>(); studentRepositoryMock.Setup(m => m.CreateAsync(this.GetStudent(It.IsAny <int>()))).ReturnsAsync(It.IsAny <int>()); IStudentService studentService = new StudentService(studentRepositoryMock.Object); var studentController = new StudentsController(studentService, this.CreateMapper()); var expected = this.GetStudent(It.IsAny <int>()); var result = await studentController.CreateAsync(this.GetStudentDto()); var okResult = Assert.IsType <CreatedAtActionResult>(result); var actual = Assert.IsAssignableFrom <DataAccess.Model.Student>(okResult.Value); actual.Should().NotBeNull(); actual.Should().BeEquivalentTo(expected); }