public void TestMerchantCalcTaxes()
        {
            CheckoutShoppingCartRequest request = new CheckoutShoppingCartRequest(MERCHANT_ID, MERCHANT_KEY, EnvironmentType.Sandbox, "USD", 120);
              request.MerchantCalculatedTax = true;

              Assert.AreEqual(true, request.MerchantCalculatedTax);

              byte[] xml = null;
              try {
            xml = request.GetXml();
            Assert.Fail("You should not be able to obtain the xml:MerchantCalculatedTax");
              }
              catch (Exception ex) {
            if (ex.Message.IndexOf("MerchantCalculatedTax=true, you must add at least one tax rule.") == -1) {
              Assert.Fail(ex.Message);
            }
              }

              //now we want to set a tax table and let it blow up because the callback url was not set.
              request.AddStateTaxRule("OH", .06, true);

              try {
            xml = request.GetXml();
            Assert.Fail("You should not be able to obtain the xml:AddStateTaxRule");
              }
              catch (Exception ex) {
            if (ex.Message.IndexOf("MerchantCalculatedTax=true, you must set MerchantCalculationsUrl.") == -1) {
              Assert.Fail(ex.Message);
            }
              }

              request.MerchantCalculatedTax = false;
              request.AcceptMerchantCoupons = true;

              try {
            xml = request.GetXml();
            Assert.Fail("You should not be able to obtain the xml:AcceptMerchantCoupons");
              }
              catch (Exception ex) {
            if (ex.Message.IndexOf("AcceptMerchantCoupons=true, you must set MerchantCalculationsUrl.") == -1) {
              Assert.Fail(ex.Message);
            }
              }

              request.AcceptMerchantCoupons = false;
              request.AcceptMerchantGiftCertificates = true;

              try {
            xml = request.GetXml();
            Assert.Fail("You should not be able to obtain the xml:AcceptMerchantGiftCertificates");
              }
              catch (Exception ex) {
            if (ex.Message.IndexOf("AcceptMerchantGiftCertificates=true, you must set") == -1) {
              Assert.Fail(ex.Message);
            }
              }

              request.AcceptMerchantGiftCertificates = false;

              //set to false to test carrier option
              request.MerchantCalculationsUrl = "http://localhost/test.aspx";

              //Ship from test
              request.AddCarrierCalculatedShippingOption(ShippingType.Fedex_Second_Day, 4.99m);

              try {
            xml = request.GetXml();
            Assert.Fail("You should not be able to obtain the xml:carrier-calculated-shipping item exists");
              }
              catch (Exception ex) {
            if (ex.Message.IndexOf("a ShipFrom address must also be set") == -1) {
              Assert.Fail(ex.Message);
            }
              }
        }