public void should_return_one_author() { //arrange Author _existingAuthors = new Author() { Idauth = 1, FirstName = "Justin1", LastName = "test1", PhoneNumber = "202020" }; var authors = new Mock <IAuthorRepository>(); authors.Setup(c => c.GetAuthorById(1)).ReturnsAsync(_existingAuthors); //act AuthorController home = new AuthorController(authors.Object); var result = home.GetAuthorById(1); Console.WriteLine("Justin1" + result.FirstName); //assert Assert.AreEqual("Justin1", result.FirstName); }