Пример #1
0
        public void TransferSerializeTest()
        {
            JArray a                       = JArray.Parse(Properties.Resources.payments);
            String expectedJSON            = a[3].ToString();
            String actualJSON              = null;
            KondutoTransferPayment payment = KondutoPaymentFactory.CreateTransferPayment();

            try
            {
                actualJSON = payment.ToJson();
            }
            catch (KondutoInvalidEntityException e)
            {
                Assert.Fail("payment should be valid");
            }

            Assert.AreEqual(expectedJSON, actualJSON, "address serialization failed");

            KondutoTransferPayment paymentFromJSON = KondutoModel.FromJson <KondutoTransferPayment>(expectedJSON);

            Assert.AreEqual(payment, paymentFromJSON, "payment deserialization failed");
        }