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


C# Plan类代码示例

本文整理汇总了C#中Plan的典型用法代码示例。如果您正苦于以下问题:C# Plan类的具体用法?C# Plan怎么用?C# Plan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CreatePlan

        public void CreatePlan()
        {
            var plan = new Plan(GetMockPlanCode(), GetMockPlanName())
            {
                AccountingCode = "accountingcode123",
                SetupFeeAccountingCode = "setupfeeac",
                Description = "a test plan",
                DisplayDonationAmounts = true,
                DisplayPhoneNumber = false,
                DisplayQuantity = true,
                TotalBillingCycles = 5,
                TrialIntervalUnit = Plan.IntervalUnit.Months,
                TrialIntervalLength = 1,
                PlanIntervalUnit = Plan.IntervalUnit.Days,
                PlanIntervalLength = 180
            };
            plan.SetupFeeInCents.Add("USD", 500);
            plan.Create();
            PlansToDeactivateOnDispose.Add(plan);

            plan.CreatedAt.Should().NotBe(default(DateTime));
            plan.AccountingCode.Should().Be("accountingcode123");
            plan.SetupFeeAccountingCode.Should().Be("setupfeeac");
            plan.Description.Should().Be("a test plan");
            plan.DisplayDonationAmounts.Should().HaveValue().And.Be(true);
            plan.DisplayPhoneNumber.Should().HaveValue().And.Be(false);
            plan.DisplayQuantity.Should().HaveValue().And.Be(true);
            plan.TotalBillingCycles.Should().Be(5);
            plan.TrialIntervalUnit.Should().Be(Plan.IntervalUnit.Months);
            plan.TrialIntervalLength.Should().Be(1);
            plan.PlanIntervalUnit.Should().Be(Plan.IntervalUnit.Days);
            plan.PlanIntervalLength.Should().Be(180);
        }
开发者ID:kylelengling,项目名称:recurly-client-net,代码行数:33,代码来源:PlanTest.cs

示例2: LookupCouponInvoice

        public void LookupCouponInvoice()
        {
            var discounts = new Dictionary<string, int> { { "USD", 1000 } };
            var coupon = new Coupon(GetMockCouponCode(), GetMockCouponName(), discounts);
            coupon.Create();

            var plan = new Plan(GetMockPlanCode(), GetMockPlanCode())
            {
                Description = "Test Lookup Coupon Invoice"
            };
            plan.UnitAmountInCents.Add("USD", 1500);
            plan.Create();
            PlansToDeactivateOnDispose.Add(plan);

            var account = CreateNewAccountWithBillingInfo();

            var redemption = account.RedeemCoupon(coupon.CouponCode, "USD");

            var sub = new Subscription(account, plan, "USD", coupon.CouponCode);
            sub.Create();

            // TODO complete this test

            var invoices = account.GetInvoices();

            invoices.Should().NotBeEmpty();

            var invoice = Invoices.Get(invoices.First().InvoiceNumber);
            var fromInvoice = invoice.GetRedemption();

            redemption.Should().Be(fromInvoice);
        }
开发者ID:kylelengling,项目名称:recurly-client-net,代码行数:32,代码来源:CouponRedemptionTest.cs

示例3: GetAllPlansTest

        public void GetAllPlansTest()
        {
            // Setup dependency
            var settingsMock = new Mock<ISettings>();
            var repositoryMock = new Mock<IRepository>();
            var uowMock = new Mock<IUnitOfWork>();
            var serviceLocatorMock = new Mock<IServiceLocator>();
            serviceLocatorMock.Setup(x => x.GetInstance<IRepository>())
                .Returns(repositoryMock.Object);
            ServiceLocator.SetLocatorProvider(() => serviceLocatorMock.Object);

            // Arrange
            decimal expectedResult = 10;
            List<Plan> plans = new List<Plan>();
            for (int i = 0; i < expectedResult; i++)
            {
                Plan plan = new Plan
                {
                    Id = Guid.NewGuid()
                };
                plans.Add(plan);
            }

            repositoryMock.Setup(r => r.Query<Plan>()).Returns(plans.AsQueryable());

            // Act
            PlanService bookingService = new PlanService(uowMock.Object, repositoryMock.Object, settingsMock.Object);
            List<PlanDto> currentResult = bookingService.GetAllPlans();

            // Assert
            repositoryMock.Verify(repo => repo.Query<Plan>());
            Assert.AreEqual(expectedResult, currentResult.Count());
        }
开发者ID:nguyenminhthu,项目名称:TeleConsult,代码行数:33,代码来源:PlanServiceTest.cs

示例4: CopySaveOptionsWindow

 /// <summary>
 /// Initializes a new instance of the <see cref="CopySaveOptionsWindow"/> class.
 /// </summary>
 /// <param name="pto">The pto.</param>
 /// <param name="plan">The p.</param>
 /// <param name="isForCopy">if set to <c>true</c> [is for copy].</param>
 public CopySaveOptionsWindow(PlanExportSettings pto, Plan plan, bool isForCopy)
     : this()
 {
     m_planTextOptions = pto;
     m_plan = plan;
     m_isForCopy = isForCopy;
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例5: ListExpiredSubscriptions

        public void ListExpiredSubscriptions()
        {
            var plan = new Plan(GetMockPlanCode(), GetMockPlanName())
            {
                Description = "Subscription Test",
                PlanIntervalLength = 1,
                PlanIntervalUnit = Plan.IntervalUnit.Months
            };
            plan.UnitAmountInCents.Add("USD", 400);
            plan.Create();
            PlansToDeactivateOnDispose.Add(plan);

            for (var x = 0; x < 2; x++)
            {
                var account = CreateNewAccountWithBillingInfo();
                var sub = new Subscription(account, plan, "USD")
                {
                    StartsAt = DateTime.Now.AddMonths(-5)
                };

                sub.Create();
            }

            var subs = Subscriptions.List(Subscription.SubscriptionState.Expired);
            subs.Should().NotBeEmpty();
        }
开发者ID:Georotzen,项目名称:recurly-client-net,代码行数:26,代码来源:SubscriptionListTest.cs

示例6: btnLoad_Click

 /// <summary>
 /// When the user clicks "load", import the plan.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnLoad_Click(object sender, EventArgs e)
 {
     SourcePlan = (Plan)lbPlan.SelectedItem;
     TargetPlan = SourcePlan.Clone(TargetCharacter);
     DialogResult = DialogResult.OK;
     Close();
 }
开发者ID:RapidFiring,项目名称:evemon,代码行数:12,代码来源:PlanImportationFromCharacterWindow.cs

示例7: CreateSubscription

        public void CreateSubscription()
        {
            var plan = new Plan(GetMockPlanCode(), GetMockPlanName())
            {
                Description = "Create Subscription Test"
            };
            plan.UnitAmountInCents.Add("USD", 100);
            plan.Create();
            PlansToDeactivateOnDispose.Add(plan);

            var account = CreateNewAccountWithBillingInfo();

            var coup = CreateNewCoupon(3);
            var sub = new Subscription(account, plan, "USD");
            sub.TotalBillingCycles = 5;
            sub.Coupon = coup;
            Assert.Null(sub.TaxInCents);
            Assert.Null(sub.TaxType);
            Assert.Null(sub.TaxRate);
            sub.Create();

            sub.ActivatedAt.Should().HaveValue().And.NotBe(default(DateTime));
            sub.State.Should().Be(Subscription.SubscriptionState.Active);
            Assert.Equal(5, sub.TotalBillingCycles);
            Assert.Equal(coup.CouponCode, sub.Coupon.CouponCode);
            Assert.Equal(9, sub.TaxInCents.Value);
            Assert.Equal("usst", sub.TaxType);
            Assert.Equal(0.0875M, sub.TaxRate.Value);

            var sub1 = Subscriptions.Get(sub.Uuid);
            Assert.Equal(5, sub1.TotalBillingCycles);
        }
开发者ID:Georotzen,项目名称:recurly-client-net,代码行数:32,代码来源:SubscriptionTest.cs

示例8: CalculateAdvantage

 private int CalculateAdvantage(Plan plan)
 {
     IDictionary<IPlayer, int> scores = GameState.Players.ToDictionary(p => p, p => GameState.PlayerScore(p)+plan.Worth(p));
     if (scores[Player]>scores.Where(kvp => kvp.Key != Player).Max(kvp => kvp.Value))
         return scores.Where(kvp => kvp.Key != Player).Sum(kvp => scores[Player]-kvp.Value);
     return scores.Where(kvp => kvp.Key != Player && kvp.Value>scores[Player]).Sum(kvp => scores[Player]-kvp.Value);
 }
开发者ID:llanes1990,项目名称:RecreatingInfiniteCity,代码行数:7,代码来源:Skynet.cs

示例9: EnqueuePlan

 private static void EnqueuePlan(Plan plan, Queue<object> queue)
 {
     queue.Enqueue(plan.Tile);
     queue.Enqueue(plan.Space);
     if (plan.Arguments != null)
         foreach (object item in plan.Arguments)
             queue.Enqueue(item);
 }
开发者ID:llanes1990,项目名称:RecreatingInfiniteCity,代码行数:8,代码来源:Skynet.cs

示例10: TestDefaults

 public void TestDefaults()
 {
     var plan = new Plan();
       Assert.That(plan.Executable, Is.Null);
       Assert.That(plan.Assembly, Is.Null);
       Assert.That(plan.Run, Is.Null);
       Assert.That(plan.ID, Is.Null);
 }
开发者ID:asipe,项目名称:Nucs,代码行数:8,代码来源:PlanTest.cs

示例11: ListPlans

        public void ListPlans()
        {
            var plan = new Plan(GetMockPlanCode(), GetMockPlanName());
            plan.SetupFeeInCents.Add("USD", 100);
            plan.Create();
            PlansToDeactivateOnDispose.Add(plan);

            var plans = Plans.List();
            plans.Should().NotBeEmpty();
        }
开发者ID:Georotzen,项目名称:recurly-client-net,代码行数:10,代码来源:PlanListTest.cs

示例12: CreatePlanSmall

        public void CreatePlanSmall()
        {
            var plan = new Plan(GetMockPlanCode(), GetMockPlanName());
            plan.SetupFeeInCents.Add("USD", 100);
            plan.Create();
            PlansToDeactivateOnDispose.Add(plan);

            plan.CreatedAt.Should().NotBe(default(DateTime));
            plan.SetupFeeInCents.Should().Contain("USD", 100);
        }
开发者ID:kylelengling,项目名称:recurly-client-net,代码行数:10,代码来源:PlanTest.cs

示例13: AttributesOptimizationForm

 /// <summary>
 /// Constructor for use in code when the user wants to manually edit a remapping point.
 /// </summary>
 /// <param name="character">Character information</param>
 /// <param name="plan">Plan to optimize for</param>
 /// <param name="strategy">Optimization strategy</param>
 /// <param name="name">Title of this form</param>
 /// <param name="description">Description of the optimization operation</param>
 public AttributesOptimizationForm(Character character, Plan plan, RemappingPoint point)
     : this()
 {
     m_plan = plan;
     m_character = character;
     m_baseCharacter = character.After(plan.ChosenImplantSet);
     m_manuallyEditedRemappingPoint = point;
     m_strategy = Strategy.ManualRemappingPointEdition;
     m_description = "Manual editing of a remapping point";
     Text = "Remapping point manual editing (" + plan.Name + ")";
 }
开发者ID:wow4all,项目名称:evemu_server,代码行数:19,代码来源:AttributesOptimizationForm.cs

示例14: PlanPrinter

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="plan">The plan.</param>
        private PlanPrinter(Plan plan)
        {
            m_plan = plan;
            m_plan.UpdateStatistics();

            m_character = (Character)plan.Character;
            m_settings = Settings.Exportation.PlanToText;

            m_font = FontFactory.GetFont("Arial", 10);
            m_boldFont = FontFactory.GetFont("Arial", 10, FontStyle.Bold | FontStyle.Underline);
        }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例15: AttributesOptimizationSettingsForm

        public AttributesOptimizationSettingsForm(Plan plan)
        {
            InitializeComponent();

            buttonWholePlan.Font = FontFactory.GetFont("Microsoft Sans Serif", 10F);
            buttonCharacter.Font = FontFactory.GetFont("Microsoft Sans Serif", 10F);
            buttonRemappingPoints.Font = FontFactory.GetFont("Microsoft Sans Serif", 10F);

            m_plan = plan;
            m_character = (Character)plan.Character;
        }
开发者ID:wow4all,项目名称:evemu_server,代码行数:11,代码来源:AttributesOptimizationSettingsForm.cs


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