Ejemplo n.º 1
0
        public void MerchantOrder_UpdateShouldBeOk()
        {
            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()
            {
                ID = "1"
            };

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

            Assert.Pass();
        }
Ejemplo n.º 2
0
        public void MerchantOrder_UpdateShouldRaiseException()
        {
            MerchantOrder merchantOrderInternal = new MerchantOrder()
            {
                ID = "1"
            };

            merchantOrderInternal.ID = "2";

            try
            {
                var result = merchantOrderInternal.Update();
            }
            catch (MPException mpException)
            {
                Assert.AreEqual("\"client_id\" and \"client_secret\" can not be \"null\" when getting the \"access_token\"", mpException.Message);
            }

            Assert.Pass();
        }