public void MapClientResponseToRequest()
        {
            var mapper = new ApiPipelineModelMapper();
            var model  = new ApiPipelineClientResponseModel();

            model.SetProperties(1, 1, 1);
            ApiPipelineClientRequestModel response = mapper.MapClientResponseToRequest(model);

            response.Should().NotBeNull();
            response.PipelineStatusId.Should().Be(1);
            response.SaleId.Should().Be(1);
        }
Ejemplo n.º 2
0
        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());
            ApiPipelineClientResponseModel response = await client.PipelineGetAsync(default(int));

            response.Should().BeNull();
        }
Ejemplo n.º 3
0
        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;

            ApiPipelineClientResponseModel response = await client.PipelineGetAsync(1);

            response.Should().NotBeNull();
            response.Id.Should().Be(1);
            response.PipelineStatusId.Should().Be(1);
            response.SaleId.Should().Be(1);
        }