本文整理汇总了C#中Plan类的典型用法代码示例。如果您正苦于以下问题:C# Plan类的具体用法?C# Plan怎么用?C# Plan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Plan类属于命名空间,在下文中一共展示了Plan类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ShowDialog
/// <summary>
/// Creates the dialog based upon a plan.
/// </summary>
/// <param name="plan">Plan to display obsolete entries from</param>
/// <returns>Action to be taken</returns>
public static ObsoleteEntriesAction ShowDialog(Plan plan)
{
if (plan == null)
return ObsoleteEntriesAction.None;
if (!plan.ContainsObsoleteEntries)
return ObsoleteEntriesAction.None;
ObsoleteEntriesForm form = new ObsoleteEntriesForm(plan);
return form.ShowObsoleteEntriesDialog();
}
开发者ID:wow4all,项目名称:evemu_server,代码行数:16,代码来源:ObsoleteEntriesForm.cs
示例17: LoadoutImportationWindow
/// <summary>
/// Constructor.
/// </summary>
/// <param name="plan">The plan.</param>
/// <exception cref="System.ArgumentNullException">plan</exception>
public LoadoutImportationWindow(Plan plan)
: this()
{
plan.ThrowIfNull(nameof(plan));
Plan = plan;
EveMonClient.CharacterUpdated += EveMonClient_CharacterUpdated;
EveMonClient.PlanChanged += EveMonClient_PlanChanged;
EveMonClient.PlanNameChanged += EveMonClient_PlanNameChanged;
}
开发者ID:RapidFiring,项目名称:evemon,代码行数:16,代码来源:LoadoutImportationWindow.cs
示例18: EFTLoadoutImportationForm
/// <summary>
/// Constructor
/// </summary>
public EFTLoadoutImportationForm(Plan plan)
{
InitializeComponent();
topSplitContainer.RememberDistanceKey = "EFTLoadoutImportationForm";
m_plan = plan;
m_character = m_plan.Character;
EveClient.CharacterChanged += EveClient_CharacterChanged;
EveClient.PlanChanged += EveClient_PlanChanged;
}
开发者ID:wow4all,项目名称:evemu_server,代码行数:14,代码来源:EFTLoadoutImportationForm.cs
示例19: ShowDialog
/// <summary>
/// Creates the dialog based upon a plan.
/// </summary>
/// <param name="plan">Plan to display obsolete entries from</param>
/// <returns>Action to be taken</returns>
public static ObsoleteEntriesAction ShowDialog(Plan plan)
{
if (plan == null)
return ObsoleteEntriesAction.None;
if (!plan.ContainsObsoleteEntries)
return ObsoleteEntriesAction.None;
using (ObsoleteEntriesWindow form = new ObsoleteEntriesWindow(plan))
{
return form.ShowObsoleteEntriesDialog();
}
}
开发者ID:RapidFiring,项目名称:evemon,代码行数:18,代码来源:ObsoleteEntriesWindow.cs
示例20: MainWindow
public MainWindow()
{
InitializeComponent();
_plan = (Plan)FindResource("Plan");
_log = (Plan)FindResource("Log");
Closing += OnClosing;
if (_json.FolderExists() == true)
{
_plan = _json.Deserialize();
}
}
开发者ID:BjornNorgaard,项目名称:I4GUI,代码行数:14,代码来源:MainWindow.xaml.cs
注:本文中的Plan类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论