本文整理汇总了C#中Operation.Do方法的典型用法代码示例。如果您正苦于以下问题:C# Operation.Do方法的具体用法?C# Operation.Do怎么用?C# Operation.Do使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operation
的用法示例。
在下文中一共展示了Operation.Do方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateTest
public void CalculateTest()
{
ICustomer customer1 = Bank1.Customers.First();
customer1.Accounts.First().Balance = 1000;
IOperation operation1 = new Operation(Operations.Deposit, new object[]{ customer1, 1000, DateTime.Now } );
operation1.Do();
operation1.Undo();
Assert.AreEqual(customer1.Accounts.Last().History.Last().Details, "PENALTY");
ICustomer customer2 = Bank1.Customers.Last();
customer2.Accounts.First().Balance = 5000;
IOperation operation2 = new Operation(Operations.Deposit, new object[] { customer2, 5000, DateTime.Now });
operation2.Do();
customer2.Accounts.Last().OpenDate = DateTime.Now.AddMonths(-13);
operation2.Undo();
Assert.AreEqual(customer2.Accounts.Last().History[1].Details, "PREMIUM");
}