Braintree.Tests.Integration.DiscountIntegrationTest.All_ReturnsAllDiscounts C# (CSharp) Метод

All_ReturnsAllDiscounts() приватный Метод

private All_ReturnsAllDiscounts ( ) : void
Результат void
        public void All_ReturnsAllDiscounts()
        {
            string discountId = string.Format("dotnet_discount{0}", new Random().Next(1000000).ToString());

            service.Post(service.MerchantPath() + "/modifications/create_modification_for_tests", new ModificationRequestForTests {
                Amount = 100M,
                Description = "a test discount",
                Id = discountId,
                Kind = "discount",
                Name = "discount_name",
                NeverExpires = false,
                NumberOfBillingCycles = 12
            });

            List<Discount> collection = gateway.Discount.All();
            Assert.IsNotEmpty(collection);

            Discount discount = collection.Find
            (
                delegate(Discount d)
                {
                    return d.Id == discountId;
                }
            );

            Assert.AreEqual(100M, discount.Amount);
            Assert.AreEqual("a test discount", discount.Description);
            Assert.AreEqual(discountId, discount.Id);
            Assert.AreEqual("discount", discount.Kind);
            Assert.AreEqual("discount_name", discount.Name);
            Assert.AreEqual(false, discount.NeverExpires);
            Assert.AreEqual(12, discount.NumberOfBillingCycles);
            Assert.IsNotNull(discount.CreatedAt);
            Assert.IsNotNull(discount.UpdatedAt);
        }
    }
DiscountIntegrationTest