Example #1
0
        public void MerchantOrderLoadTest()
        {
            var merchantOrder = NewMerchantOrder();

            merchantOrder.Save();
            Assert.IsNotNull(merchantOrder.ID);

            var loadMerchantOrder = new MerchantOrder
            {
                ID = merchantOrder.ID,
            };

            loadMerchantOrder.Load(merchantOrder.ID);
            Assert.IsNull(loadMerchantOrder.Errors);
            Assert.AreEqual(merchantOrder.ID, loadMerchantOrder.ID);
        }
Example #2
0
        public void MerchantOrder_LoadShouldbeOk()
        {
            SDK.CleanConfiguration();
            SDK.SetBaseUrl("https://api.mercadopago.com");

            Dictionary <string, string> config = new Dictionary <string, string>();

            config.Add("clientSecret", Environment.GetEnvironmentVariable("CLIENT_SECRET"));
            config.Add("clientId", Environment.GetEnvironmentVariable("CLIENT_ID"));
            SDK.SetConfiguration(config);

            MerchantOrder merchantOrderInternal = new MerchantOrder();

            try
            {
                var result = merchantOrderInternal.Load("1234");
            }
            catch (MPException mpException)
            {
                Assert.Fail();
            }

            Assert.Pass();
        }