コード例 #1
0
        private async Task <ApiSalesReasonResponseModel> CreateRecord()
        {
            var model = new ApiSalesReasonRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), "B", "B");
            CreateResponse <ApiSalesReasonResponseModel> result = await this.Client.SalesReasonCreateAsync(model);

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

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

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.ReasonType.Should().Be("A");
        }
コード例 #3
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiSalesReasonModelMapper();
            var model  = new ApiSalesReasonRequestModel();

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

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.ReasonType.Should().Be("A");
            response.SalesReasonID.Should().Be(1);
        }
コード例 #4
0
        public void CreatePatch()
        {
            var mapper = new ApiSalesReasonModelMapper();
            var model  = new ApiSalesReasonRequestModel();

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

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

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