Esempio n. 1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IApiKeyRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult <ApiKey>(null));
            var service = new ApiKeyService(mock.LoggerMock.Object,
                                            mock.RepositoryMock.Object,
                                            mock.ModelValidatorMockFactory.ApiKeyModelValidatorMock.Object,
                                            mock.BOLMapperMockFactory.BOLApiKeyMapperMock,
                                            mock.DALMapperMockFactory.DALApiKeyMapperMock);

            ApiApiKeyResponseModel response = await service.Get(default(string));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>()));
        }