Exemple #1
0
        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 ApiBucketRequestModel();

            createModel.SetProperties(Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"), "B");
            CreateResponse <ApiBucketResponseModel> createResult = await client.BucketCreateAsync(createModel);

            createResult.Success.Should().BeTrue();

            ApiBucketResponseModel getResponse = await client.BucketGetAsync(2);

            getResponse.Should().NotBeNull();

            ActionResponse deleteResult = await client.BucketDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();

            ApiBucketResponseModel verifyResponse = await client.BucketGetAsync(2);

            verifyResponse.Should().BeNull();
        }
Exemple #2
0
        private async Task <ApiBucketResponseModel> CreateRecord()
        {
            var model = new ApiBucketRequestModel();

            model.SetProperties(Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"), "B");
            CreateResponse <ApiBucketResponseModel> result = await this.Client.BucketCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
        public void MapModelToBO()
        {
            var mapper = new BOLBucketMapper();
            ApiBucketRequestModel model = new ApiBucketRequestModel();

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

            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Name.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiBucketModelMapper();
            var model  = new ApiBucketRequestModel();

            model.SetProperties(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A");

            JsonPatchDocument <ApiBucketRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiBucketRequestModel();

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