public void MapClientRequestToResponse()
        {
            var mapper = new ApiBucketModelMapper();
            var model  = new ApiBucketClientRequestModel();

            model.SetProperties(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A");
            ApiBucketClientResponseModel response = mapper.MapClientRequestToResponse(1, model);

            response.Should().NotBeNull();
            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Name.Should().Be("A");
        }
Пример #2
0
        public virtual async void TestByNameNotFound()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApiBucketClientResponseModel response = await client.ByBucketByName("test_value");

            response.Should().BeNull();
        }
Пример #3
0
        public virtual async void TestByNameFound()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApiBucketClientResponseModel response = await client.ByBucketByName("A");

            response.Should().NotBeNull();

            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }