本文整理汇总了C#中System.Item.SetDestinationLazy方法的典型用法代码示例。如果您正苦于以下问题:C# Item.SetDestinationLazy方法的具体用法?C# Item.SetDestinationLazy怎么用?C# Item.SetDestinationLazy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Item
的用法示例。
在下文中一共展示了Item.SetDestinationLazy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DestinationUpdatedIfItemMovedLazily
public void DestinationUpdatedIfItemMovedLazily()
{
Account account1;
Account account3;
account1 = new Account
{
Name = "Bank Account",
IsValid = true,
};
account1.setType(_accountType1);
account1.setCategory(_accountCategory);
account3 = new Account
{
Name = "Not Source",
IsValid = true,
};
account3.setType(_accountType3);
account3.setCategory(_accountCategory);
var item = new Item
{
Value = 99.99M,
Description = "Move Test",
IsVerified = true,
};
item.SetDestinationLazy(account3);
Assert.AreEqual(item.Destination, account3);
Assert.AreNotEqual(item.Destination, account1);
item.SetDestinationLazy(account1);
Assert.AreEqual(item.Destination, account1);
Assert.AreNotEqual(item.Destination, account3);
}
示例2: Cannot_move_money_from_destination_only_account_lazily
public void Cannot_move_money_from_destination_only_account_lazily()
{
var item = new Item
{
Value = 99.01M,
Description = "Add Test",
IsVerified = true,
};
item.SetTransaction(_transaction1);
item.SetSourceLazy(_account3);
item.SetDestinationLazy(_account1);
}
示例3: Cannot_move_money_within_the_same_account_lazily
public void Cannot_move_money_within_the_same_account_lazily()
{
var item = new Item
{
Value = 567.78M,
Description = "Add Test",
IsVerified = true,
};
item.SetTransaction(_transaction1);
item.SetSourceLazy(_account1);
item.SetDestinationLazy(_account1);
}