public void All_ReturnsAllPlans()
{
string planToken = string.Format("plan{0}", new Random().Next(1000000).ToString());
service.Post(service.MerchantPath() + "/plans/create_plan_for_tests", new PlanRequestForTests {
BillingDayOfMonth = 1,
BillingFrequency = 1,
CurrencyIsoCode = "USD",
Description = "a_test_plan",
Id = planToken,
Name = "dotnet_plan",
NumberOfBillingCycles = 1,
Price = 100.00M,
TrialPeriod = false,
});
List<Plan> collection = gateway.Plan.All();
Assert.IsNotEmpty(collection);
Plan plan = collection.Find
(
delegate(Plan p)
{
return p.Id == planToken;
}
);
Assert.AreEqual("dotnet_plan", plan.Name);
Assert.AreEqual(1, plan.BillingDayOfMonth);
Assert.AreEqual(1, plan.BillingFrequency);
Assert.AreEqual("USD", plan.CurrencyIsoCode);
Assert.AreEqual("a_test_plan", plan.Description);
Assert.AreEqual(1, plan.NumberOfBillingCycles);
Assert.AreEqual(100.00M, plan.Price);
Assert.AreEqual(false, plan.TrialPeriod);
}