本文整理匯總了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);
}