public async void AddBookReturnsFase() { //Arrange var mockService = new Mock <IBookService>(); var mockMerdiatR = new Mock <IMediator>(); _bookController = new BookController(mockService.Object, mockMerdiatR.Object); _bookController.ModelState.AddModelError("Name", "Required"); Book newBook = new Book(); //Act var isBookAdded = await _bookController.AddNewBook(newBook); //Assert Assert.Equal(false, isBookAdded.Value); }