コード例 #1
0
        private async Task <ApiStateProvinceResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiStateProvinceRequestModel();

            model.SetProperties("B", true, DateTime.Parse("1/1/1988 12:00:00 AM"), "B", Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"), "B", 2);
            CreateResponse <ApiStateProvinceResponseModel> result = await client.StateProvinceCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
コード例 #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLStateProvinceMapper();
            ApiStateProvinceRequestModel model = new ApiStateProvinceRequestModel();

            model.SetProperties("A", true, DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A", 1);
            BOStateProvince response = mapper.MapModelToBO(1, model);

            response.CountryRegionCode.Should().Be("A");
            response.IsOnlyStateProvinceFlag.Should().Be(true);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.StateProvinceCode.Should().Be("A");
            response.TerritoryID.Should().Be(1);
        }
コード例 #3
0
        public void CreatePatch()
        {
            var mapper = new ApiStateProvinceModelMapper();
            var model  = new ApiStateProvinceRequestModel();

            model.SetProperties("A", true, DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A", 1);

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

            patch.ApplyTo(response);
            response.CountryRegionCode.Should().Be("A");
            response.IsOnlyStateProvinceFlag.Should().Be(true);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.StateProvinceCode.Should().Be("A");
            response.TerritoryID.Should().Be(1);
        }