public void Should_return_second_plan_for_upgrade_if_plan_is_null() { var sut = new ConfigAppPlansProvider(Plans); var upgradePlan = sut.GetPlanUpgrade(null); upgradePlan.ShouldBeEquivalentTo(BasicPlan); }
public void Should_return_fitting_app_plan() { var sut = new ConfigAppPlansProvider(Plans); var plan = sut.GetPlanForApp(CreateApp("basic")); plan.ShouldBeEquivalentTo(BasicPlan); }
public void Should_smallest_plan_if_none_fits() { var sut = new ConfigAppPlansProvider(Plans); var plan = sut.GetPlanForApp(CreateApp("enterprise")); plan.ShouldBeEquivalentTo(FreePlan); }
public void Should_return_next_plan_if_plan_is_upgradeable() { var sut = new ConfigAppPlansProvider(Plans); var upgradePlan = sut.GetPlanUpgradeForApp(CreateApp("free")); upgradePlan.ShouldBeEquivalentTo(BasicPlan); }
public void Should_return_infinite_if_nothing_configured(string planId) { var sut = new ConfigAppPlansProvider(Enumerable.Empty <ConfigAppLimitsPlan>()); var plan = sut.GetPlanForApp(CreateApp(planId)); plan.ShouldBeEquivalentTo(InfinitePlan); }
public void Should_return_second_plan_for_upgrade_if_plan_not_found() { var sut = new ConfigAppPlansProvider(Plans); var upgradePlan = sut.GetPlanUpgradeForApp(CreateApp("enterprise")); upgradePlan.ShouldBeEquivalentTo(BasicPlan); }
public void Should_not_return_plan_for_upgrade_if_plan_is_highest_plan() { var sut = new ConfigAppPlansProvider(Plans); var upgradePlan = sut.GetPlanUpgradeForApp(CreateApp("basic")); Assert.Null(upgradePlan); }
public void Should_return_infinite_plan_for_free_plan_if_not_found() { var sut = new ConfigAppPlansProvider(Enumerable.Empty <ConfigAppLimitsPlan>()); var plan = sut.GetFreePlan(); plan.Should().NotBeNull(); }
public void Should_return_free_plan() { var sut = new ConfigAppPlansProvider(Plans); var plan = sut.GetFreePlan(); plan.Should().BeEquivalentTo(FreePlan); }
public void Should_return_fitting_app_plan() { var sut = new ConfigAppPlansProvider(Plans); var result = sut.GetPlanForApp(CreateApp("basic")); result.Should().BeEquivalentTo((BasicPlan, "basic")); }
public void Should_smallest_plan_if_none_fits() { var sut = new ConfigAppPlansProvider(Plans); var result = sut.GetPlanForApp(CreateApp("enterprise")); result.Should().BeEquivalentTo((FreePlan, "free")); }
public void Should_check_plan_exists() { var sut = new ConfigAppPlansProvider(Plans); Assert.True(sut.IsConfiguredPlan("basic")); Assert.True(sut.IsConfiguredPlan("free")); Assert.False(sut.IsConfiguredPlan("infinite")); Assert.False(sut.IsConfiguredPlan("invalid")); Assert.False(sut.IsConfiguredPlan(null)); }
public void Should_smallest_plan_if_none_fits() { var sut = new ConfigAppPlansProvider(Plans); var plan = sut.GetPlanForApp(CreateApp("Enterprise")); plan.ShouldBeEquivalentTo(new ConfigAppLimitsPlan { Id = "free", Name = "Free", MaxApiCalls = 50000, MaxAssetSize = 1024 * 1024 * 10, MaxContributors = 2 }); }
public void Should_return_fitting_app_plan() { var sut = new ConfigAppPlansProvider(Plans); var plan = sut.GetPlanForApp(CreateApp("basic")); plan.ShouldBeEquivalentTo(new ConfigAppLimitsPlan { Id = "basic", Name = "Basic", MaxApiCalls = 150000, MaxAssetSize = 1024 * 1024 * 2, MaxContributors = 5 }); }
public void Should_return_infinite_if_nothing_configured(string planId) { var sut = new ConfigAppPlansProvider(Enumerable.Empty <ConfigAppLimitsPlan>()); var plan = sut.GetPlanForApp(CreateApp(planId)); plan.ShouldBeEquivalentTo(new ConfigAppLimitsPlan { Id = "infinite", Name = "Infinite", MaxApiCalls = -1, MaxAssetSize = -1, MaxContributors = -1 }); }
public void Should_return_plans() { var sut = new ConfigAppPlansProvider(Plans); Plans.OrderBy(x => x.MaxApiCalls).ShouldBeEquivalentTo(sut.GetAvailablePlans()); }