public async void ByUserId_Not_Exists() { var mock = new ServiceMockFacade <IMessengerService, IMessengerRepository>(); mock.RepositoryMock.Setup(x => x.ByUserId(It.IsAny <int?>(), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <Messenger> >(new List <Messenger>())); var service = new MessengerService(mock.LoggerMock.Object, mock.MediatorMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.MessengerModelValidatorMock.Object, mock.DALMapperMockFactory.DALMessengerMapperMock); List <ApiMessengerServerResponseModel> response = await service.ByUserId(default(int)); response.Should().BeEmpty(); mock.RepositoryMock.Verify(x => x.ByUserId(It.IsAny <int?>(), It.IsAny <int>(), It.IsAny <int>())); }