private async Task <ApiVendorResponseModel> CreateRecord()
        {
            var model = new ApiVendorRequestModel();

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

            result.Success.Should().BeTrue();
            return(result.Record);
        }
        public void MapModelToBO()
        {
            var mapper = new BOLVendorMapper();
            ApiVendorRequestModel model = new ApiVendorRequestModel();

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

            response.AccountNumber.Should().Be("A");
            response.ActiveFlag.Should().Be(true);
            response.CreditRating.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.PreferredVendorStatu.Should().Be(true);
            response.PurchasingWebServiceURL.Should().Be("A");
        }
Exemple #3
0
        public void CreatePatch()
        {
            var mapper = new ApiVendorModelMapper();
            var model  = new ApiVendorRequestModel();

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

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

            patch.ApplyTo(response);
            response.AccountNumber.Should().Be("A");
            response.ActiveFlag.Should().Be(true);
            response.CreditRating.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.PreferredVendorStatu.Should().Be(true);
            response.PurchasingWebServiceURL.Should().Be("A");
        }