public async void ByToUserId_Not_Exists() { var mock = new ServiceMockFacade <IMessengerService, IMessengerRepository>(); mock.RepositoryMock.Setup(x => x.ByToUserId(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.ByToUserId(default(int)); response.Should().BeEmpty(); mock.RepositoryMock.Verify(x => x.ByToUserId(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>())); }