public async void Get_null_record() { var mock = new ServiceMockFacade <IPostTypesRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <PostTypes>(null)); var service = new PostTypesService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.PostTypesModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLPostTypesMapperMock, mock.DALMapperMockFactory.DALPostTypesMapperMock); ApiPostTypesResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }
public async void TestGet() { ApiPostTypesResponseModel response = await this.Client.PostTypesGetAsync(1); response.Should().NotBeNull(); }