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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }