当前位置: 首页>>代码示例>>C#>>正文


C# Invoice.ToString方法代码示例

本文整理汇总了C#中Invoice.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Invoice.ToString方法的具体用法?C# Invoice.ToString怎么用?C# Invoice.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Invoice的用法示例。


在下文中一共展示了Invoice.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ObjectEquals

        public void ObjectEquals()
        {
            var inv1 = new Invoice
            {
                Amount = 1,
                Currency = "RUB",
            };

            var inv2 = new Invoice
            {
                Amount = inv1.Amount,
                Currency = inv1.Currency,
            };

            Assert.AreEqual(inv1.ToString(), inv2.ToString());
            inv2.Customer = "customer";
            Assert.AreNotEqual(inv1.ToString(), inv2.ToString());
            inv1.Customer = inv2.Customer;
            Assert.AreEqual(inv1.ToString(), inv2.ToString());
            inv1.CustomData["custom"] = "data";
            Assert.AreNotEqual(inv1.ToString(), inv2.ToString());
            inv2.CustomData["custom"] = "data";
            Assert.AreEqual(inv1.ToString(), inv2.ToString());
        }
开发者ID:unipag,项目名称:unipag-net,代码行数:24,代码来源:ObjectTests.cs

示例2: InvoiceCustomData

        public void InvoiceCustomData()
        {
            var inv = new Invoice
            {
                Amount = 3,
                Currency = "RUB",
            };
            inv.CustomData["sixteen"] = "being tested";
            inv.CustomData["bool"] = false;
            inv.CustomData["int"] = 42;
            inv.CustomData["decimal"] = 42.5m;
            inv.Save();

            var inv2 = Invoice.Get(inv.Id);
            Assert.AreEqual(inv.ToString(), inv2.ToString());
            Assert.AreEqual(42.5m, inv2.CustomData.Value<decimal>("decimal"));

            inv.CustomData = JObject.Parse("{\"int\": 9000}");
            inv.Save();
            Assert.AreEqual(9000, inv.CustomData.Value<int>("int"));
        }
开发者ID:unipag,项目名称:unipag-net,代码行数:21,代码来源:InvoiceTests.cs

示例3: InvoiceCreate

        public void InvoiceCreate()
        {
            var inv = new Invoice();
            Assert.Null(inv.Account);
            Assert.True(inv.Amount == 0);
            Assert.True(inv.AmountPaid == 0);
            Assert.Null(inv.Currency);
            Assert.Null(inv.Customer);
            Assert.Null(inv.Description);
            Assert.Null(inv.Created);
            Assert.Null(inv.Modified);
            Assert.Null(inv.Expires);
            Assert.Null(inv.TestMode);
            Assert.Null(inv.Reference);

            inv.Amount = 42.9m;
            inv.Currency = "RUB";
            inv.Customer = "Посвящаю эту песню Ринату";
            inv.Description = "Test invoice ®";
            inv.Save();

            Assert.AreEqual("acc_111tov4zxNTQObb3", inv.Account);
            Assert.AreEqual(42.9m, inv.Amount);
            Assert.AreEqual(0, inv.AmountPaid);
            Assert.AreEqual("RUB", inv.Currency);
            Assert.AreEqual("Посвящаю эту песню Ринату", inv.Customer);
            Assert.AreEqual("Test invoice ®", inv.Description);
            Assert.That(inv.Created, Is.EqualTo(DateTime.UtcNow).Within(5).Minutes);
            Assert.That(inv.Modified, Is.EqualTo(DateTime.UtcNow).Within(5).Minutes);
            Assert.AreEqual("", inv.Reference);
            Assert.Null(inv.Expires);
            Assert.AreEqual(false, inv.TestMode);

            var inv2 = Invoice.Get(inv.Id);
            Assert.AreEqual(inv.ToString(), inv2.ToString());
        }
开发者ID:unipag,项目名称:unipag-net,代码行数:36,代码来源:InvoiceTests.cs


注:本文中的Invoice.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。