public void GetAllAgentsCheckRequestCreate() { //Arrange var mockLogger = new Mock <ILogger <AgentsController> >(); var mock = new Mock <IAgentsRepository>(); mock.Setup(a => a.GetAll()).Returns(new List <AgentModel>()).Verifiable(); var controller = new AgentsController(mock.Object, mockLogger.Object); //Act var result = controller.GetAllAgents(); //Assert mock.Verify(repository => repository.GetAll(), Times.AtMostOnce()); mockLogger.Verify(); }