public void MapClientRequestToResponse() { var mapper = new ApiPipelineStepStepRequirementModelMapper(); var model = new ApiPipelineStepStepRequirementClientRequestModel(); model.SetProperties("A", 1, true); ApiPipelineStepStepRequirementClientResponseModel response = mapper.MapClientRequestToResponse(1, model); response.Should().NotBeNull(); response.Details.Should().Be("A"); response.PipelineStepId.Should().Be(1); response.RequirementMet.Should().Be(true); }
public virtual async void TestGetNotFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApiPipelineStepStepRequirementClientResponseModel response = await client.PipelineStepStepRequirementGetAsync(default(int)); response.Should().BeNull(); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiPipelineStepStepRequirementClientResponseModel response = await client.PipelineStepStepRequirementGetAsync(1); response.Should().NotBeNull(); response.Details.Should().Be("A"); response.Id.Should().Be(1); response.PipelineStepId.Should().Be(1); response.RequirementMet.Should().Be(true); }