Esempio n. 1
0
        private async Task <ApiSubscriptionResponseModel> CreateRecord()
        {
            var model = new ApiSubscriptionRequestModel();

            model.SetProperties(true, "B", "B", "B");
            CreateResponse <ApiSubscriptionResponseModel> result = await this.Client.SubscriptionCreateAsync(model);

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

            model.SetProperties(true, "A", "A", "A");
            BOSubscription response = mapper.MapModelToBO("A", model);

            response.IsDisabled.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
            response.Type.Should().Be("A");
        }
        public void MapRequestToResponse()
        {
            var mapper = new ApiSubscriptionModelMapper();
            var model  = new ApiSubscriptionRequestModel();

            model.SetProperties(true, "A", "A", "A");
            ApiSubscriptionResponseModel response = mapper.MapRequestToResponse("A", model);

            response.Id.Should().Be("A");
            response.IsDisabled.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
            response.Type.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiSubscriptionModelMapper();
            var model  = new ApiSubscriptionRequestModel();

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

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

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