public void Search_OnPlanIdEndsWith()
{
TestPlan triallessPlan = PlanFixture.PLAN_WITHOUT_TRIAL;
TestPlan trialPlan = PlanFixture.PLAN_WITH_TRIAL;
SubscriptionRequest request1 = new SubscriptionRequest
{
PaymentMethodToken = creditCard.Token,
PlanId = trialPlan.Id,
Price = 9M
};
SubscriptionRequest request2 = new SubscriptionRequest
{
PaymentMethodToken = creditCard.Token,
PlanId = triallessPlan.Id,
Price = 9M
};
Subscription trialSubscription = gateway.Subscription.Create(request1).Target;
Subscription triallessSubscription = gateway.Subscription.Create(request2).Target;
SubscriptionSearchRequest request = new SubscriptionSearchRequest().
PlanId.EndsWith("trial_plan").
Price.Is(9M);
ResourceCollection<Subscription> collection = gateway.Subscription.Search(request);
Assert.IsTrue(TestHelper.IncludesSubscription(collection, trialSubscription));
Assert.IsFalse(TestHelper.IncludesSubscription(collection, triallessSubscription));
}