Esempio n. 1
0
        public void MapModelToBO()
        {
            var mapper = new BOLKeyAllocationMapper();
            ApiKeyAllocationRequestModel model = new ApiKeyAllocationRequestModel();

            model.SetProperties(1);
            BOKeyAllocation response = mapper.MapModelToBO("A", model);

            response.Allocated.Should().Be(1);
        }
        private async Task <ApiKeyAllocationResponseModel> CreateRecord()
        {
            var model = new ApiKeyAllocationRequestModel();

            model.SetProperties(2);
            CreateResponse <ApiKeyAllocationResponseModel> result = await this.Client.KeyAllocationCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
        public void MapRequestToResponse()
        {
            var mapper = new ApiKeyAllocationModelMapper();
            var model  = new ApiKeyAllocationRequestModel();

            model.SetProperties(1);
            ApiKeyAllocationResponseModel response = mapper.MapRequestToResponse("A", model);

            response.Allocated.Should().Be(1);
            response.CollectionName.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiKeyAllocationModelMapper();
            var model  = new ApiKeyAllocationRequestModel();

            model.SetProperties(1);

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

            patch.ApplyTo(response);
            response.Allocated.Should().Be(1);
        }