Ejemplo n.º 1
0
        public async Task GetCertifiedRestrictedDeliveryLetterRate()
        {
            Package pkg = new("72201", "99503");

            pkg.SpecialServices.SpecialService.Add(SpecialServiceIds.CertifiedMailRestrictedDelivery);

            var getRate = await RateAPI.GetRatesAsync(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 6M);
        }
Ejemplo n.º 2
0
        public async Task GetCertificateOfMailingRateAsync()
        {
            Package pkg = new("72201", "99503");

            pkg.SpecialServices.SpecialService.Add(SpecialServiceIds.CertificateofMailingForm3665);

            var getRate = await RateAPI.GetRatesAsync(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 2.01M);
        }
Ejemplo n.º 3
0
        public void GetCertifiedLetterRate()
        {
            Package pkg = new("72201", "99503");

            pkg.SpecialServices.SpecialService.Add(SpecialServiceIds.CertifiedMail);

            var getRate = RateAPI.GetRates(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 3M);
        }
Ejemplo n.º 4
0
        public void GetLetterRate()
        {
            Package pkg = new("72201", "99503")
            {
                Service = Services.FirstClass
            };

            var getRate = RateAPI.GetRates(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 0.45M);
        }
Ejemplo n.º 5
0
        public async Task GetCertifiedERRLetterRate()
        {
            Package pkg = new("72201", "99503");

            pkg.SpecialServices.SpecialService.Add(SpecialServiceIds.CertifiedMail);
            pkg.SpecialServices.SpecialService.Add(SpecialServiceIds.ReturnReceiptElectronic);

            var getRate = await RateAPI.GetRatesAsync(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 4M);
        }
Ejemplo n.º 6
0
        public async Task GetLetterRateMetered()
        {
            Package pkg = new("72201", "99503")
            {
                //ShipDate = DateTime.Now.AddDays(5).ToString()
            };

            var getRate = await RateAPI.GetRatesAsync(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 0.4M);
        }
Ejemplo n.º 7
0
        public async Task GetFlatRateMetered()
        {
            Package pkg = new("72201", "99503")
            {
                FirstClassMailType = FirstClassMailTypes.Flat
            };

            var getRate = await RateAPI.GetRatesAsync(pkg);

            // Flats don't have metered/commercial pricing
            // Error expected
            Assert.IsNotNull(getRate.Error);
        }
Ejemplo n.º 8
0
        public async Task GetFlatRate()
        {
            Package pkg = new("72201", "99503")
            {
                Service            = Services.FirstClass,
                FirstClassMailType = FirstClassMailTypes.Flat
            };

            var getRate = await RateAPI.GetRatesAsync(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 0.5M);
        }
Ejemplo n.º 9
0
        public async Task GetCertifiedFlatRate()
        {
            Package pkg = new("72201", "99503")
            {
                Service            = Services.FirstClass,
                FirstClassMailType = FirstClassMailTypes.Flat
            };

            pkg.SpecialServices.SpecialService.Add(SpecialServiceIds.CertifiedMail);

            var getRate = await RateAPI.GetRatesAsync(pkg);

            Console.WriteLine("Postage: $" + getRate.Postage.First().TotalPostage);
            Assert.IsTrue(getRate.Postage.First().TotalPostage > 3M);
        }