public async void Get_null_record() { var mock = new ServiceMockFacade <IPipelineStepRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <PipelineStep>(null)); var service = new PipelineStepService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.PipelineStepModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLPipelineStepMapperMock, mock.DALMapperMockFactory.DALPipelineStepMapperMock, mock.BOLMapperMockFactory.BOLHandlerPipelineStepMapperMock, mock.DALMapperMockFactory.DALHandlerPipelineStepMapperMock, mock.BOLMapperMockFactory.BOLOtherTransportMapperMock, mock.DALMapperMockFactory.DALOtherTransportMapperMock, mock.BOLMapperMockFactory.BOLPipelineStepDestinationMapperMock, mock.DALMapperMockFactory.DALPipelineStepDestinationMapperMock, mock.BOLMapperMockFactory.BOLPipelineStepNoteMapperMock, mock.DALMapperMockFactory.DALPipelineStepNoteMapperMock, mock.BOLMapperMockFactory.BOLPipelineStepStepRequirementMapperMock, mock.DALMapperMockFactory.DALPipelineStepStepRequirementMapperMock); ApiPipelineStepResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }
public async void TestDelete() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); var createModel = new ApiPipelineStepRequestModel(); createModel.SetProperties("B", 1, 1); CreateResponse <ApiPipelineStepResponseModel> createResult = await client.PipelineStepCreateAsync(createModel); createResult.Success.Should().BeTrue(); ApiPipelineStepResponseModel getResponse = await client.PipelineStepGetAsync(2); getResponse.Should().NotBeNull(); ActionResponse deleteResult = await client.PipelineStepDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiPipelineStepResponseModel verifyResponse = await client.PipelineStepGetAsync(2); verifyResponse.Should().BeNull(); }
public async void TestGet() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiPipelineStepResponseModel response = await client.PipelineStepGetAsync(1); response.Should().NotBeNull(); }
public async void TestGet() { ApiPipelineStepResponseModel response = await this.Client.PipelineStepGetAsync(1); response.Should().NotBeNull(); }