public async void Get_null_record() { var mock = new ServiceMockFacade <IKeyAllocationRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult <KeyAllocation>(null)); var service = new KeyAllocationService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.KeyAllocationModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLKeyAllocationMapperMock, mock.DALMapperMockFactory.DALKeyAllocationMapperMock); ApiKeyAllocationResponseModel response = await service.Get(default(string)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>())); }
public async void TestGet() { ApiKeyAllocationResponseModel response = await this.Client.KeyAllocationGetAsync("A"); response.Should().NotBeNull(); }