Exemple #1
0
        private async Task <ApiPurchaseOrderHeaderResponseModel> CreateRecord()
        {
            var model = new ApiPurchaseOrderHeaderRequestModel();

            model.SetProperties(2, 2m, DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), 2, DateTime.Parse("1/1/1988 12:00:00 AM"), 2, 2, 2m, 2m, 2m, 2);
            CreateResponse <ApiPurchaseOrderHeaderResponseModel> result = await this.Client.PurchaseOrderHeaderCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
Exemple #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLPurchaseOrderHeaderMapper();
            ApiPurchaseOrderHeaderRequestModel model = new ApiPurchaseOrderHeaderRequestModel();

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

            response.EmployeeID.Should().Be(1);
            response.Freight.Should().Be(1m);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.OrderDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.RevisionNumber.Should().Be(1);
            response.ShipDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ShipMethodID.Should().Be(1);
            response.Status.Should().Be(1);
            response.SubTotal.Should().Be(1m);
            response.TaxAmt.Should().Be(1m);
            response.TotalDue.Should().Be(1m);
            response.VendorID.Should().Be(1);
        }
        public void CreatePatch()
        {
            var mapper = new ApiPurchaseOrderHeaderModelMapper();
            var model  = new ApiPurchaseOrderHeaderRequestModel();

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

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

            patch.ApplyTo(response);
            response.EmployeeID.Should().Be(1);
            response.Freight.Should().Be(1m);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.OrderDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.RevisionNumber.Should().Be(1);
            response.ShipDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ShipMethodID.Should().Be(1);
            response.Status.Should().Be(1);
            response.SubTotal.Should().Be(1m);
            response.TaxAmt.Should().Be(1m);
            response.TotalDue.Should().Be(1m);
            response.VendorID.Should().Be(1);
        }