示例#1
0
        private async Task <ApiCountryRegionResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiCountryRegionRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), "B");
            CreateResponse <ApiCountryRegionResponseModel> result = await client.CountryRegionCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
示例#2
0
        public void MapModelToBO()
        {
            var mapper = new BOLCountryRegionMapper();
            ApiCountryRegionRequestModel model = new ApiCountryRegionRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            BOCountryRegion response = mapper.MapModelToBO("A", model);

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }
        public void MapRequestToResponse()
        {
            var mapper = new ApiCountryRegionModelMapper();
            var model  = new ApiCountryRegionRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            ApiCountryRegionResponseModel response = mapper.MapRequestToResponse("A", model);

            response.CountryRegionCode.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiCountryRegionModelMapper();
            var model  = new ApiCountryRegionRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A");

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

            patch.ApplyTo(response);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }