コード例 #1
0
        public void MapModelToBO()
        {
            var mapper = new BOLVStateProvinceCountryRegionMapper();
            ApiVStateProvinceCountryRegionRequestModel model = new ApiVStateProvinceCountryRegionRequestModel();

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

            response.CountryRegionCode.Should().Be("A");
            response.CountryRegionName.Should().Be("A");
            response.IsOnlyStateProvinceFlag.Should().Be(true);
            response.StateProvinceCode.Should().Be("A");
            response.StateProvinceName.Should().Be("A");
            response.TerritoryID.Should().Be(1);
        }
コード例 #2
0
        public void CreatePatch()
        {
            var mapper = new ApiVStateProvinceCountryRegionModelMapper();
            var model  = new ApiVStateProvinceCountryRegionRequestModel();

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

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

            patch.ApplyTo(response);
            response.CountryRegionCode.Should().Be("A");
            response.CountryRegionName.Should().Be("A");
            response.IsOnlyStateProvinceFlag.Should().Be(true);
            response.StateProvinceCode.Should().Be("A");
            response.StateProvinceName.Should().Be("A");
            response.TerritoryID.Should().Be(1);
        }