public void ExistsReturnsBool() { //Arrange var moq = new Mock <IDocumentsRepository>(); moq.Setup(m => m.Exists(It.IsAny <int>(), It.IsAny <string>())).Returns(Task.FromResult(true)); DocumentsController controller = new DocumentsController(moq.Object); //Act var result = controller.Exists(0, string.Empty).Result; //Assert Assert.IsInstanceOfType(result, typeof(bool)); Assert.IsTrue(result); }