Exemplo n.º 1
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiLifecycleModelMapper mapper = new ApiLifecycleModelMapper();

            UpdateResponse <ApiLifecycleResponseModel> updateResponse = await this.Client.LifecycleUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }
Exemplo n.º 2
0
        public void CreatePatch()
        {
            var mapper = new ApiLifecycleModelMapper();
            var model  = new ApiLifecycleRequestModel();

            model.SetProperties(BitConverter.GetBytes(1), "A", "A");

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

            patch.ApplyTo(response);
            response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
        }