Ejemplo n.º 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiUserRoleModelMapper();
            var model  = new ApiUserRoleResponseModel();

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

            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
        }
Ejemplo n.º 2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiUserRoleModelMapper mapper = new ApiUserRoleModelMapper();

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

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

            await this.Cleanup();
        }
Ejemplo n.º 3
0
        public void CreatePatch()
        {
            var mapper = new ApiUserRoleModelMapper();
            var model  = new ApiUserRoleRequestModel();

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

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

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