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

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

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

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

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

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

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

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