Пример #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiInvitationModelMapper();
            var model  = new ApiInvitationResponseModel();

            model.SetProperties("A", "A", "A");
            ApiInvitationRequestModel response = mapper.MapResponseToRequest(model);

            response.InvitationCode.Should().Be("A");
            response.JSON.Should().Be("A");
        }
Пример #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiInvitationModelMapper mapper = new ApiInvitationModelMapper();

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

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

            await this.Cleanup();
        }
Пример #3
0
        public void CreatePatch()
        {
            var mapper = new ApiInvitationModelMapper();
            var model  = new ApiInvitationRequestModel();

            model.SetProperties("A", "A");

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

            patch.ApplyTo(response);
            response.InvitationCode.Should().Be("A");
            response.JSON.Should().Be("A");
        }