本文整理汇总了C#中Account.FirstMatchingTag方法的典型用法代码示例。如果您正苦于以下问题:C# Account.FirstMatchingTag方法的具体用法?C# Account.FirstMatchingTag怎么用?C# Account.FirstMatchingTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account.FirstMatchingTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FirstMatchingTag_returns_null_if_no_tags_match
public void FirstMatchingTag_returns_null_if_no_tags_match()
{
var account = new Account(1, "Halifax - SIF ISA", AccountType.Asset);
var tagFilter = new System.Collections.Generic.List<AccountTag> {_accountTag1, _accountTag2};
var firstMatchingTag = account.FirstMatchingTag(tagFilter);
Assert.IsNull(firstMatchingTag);
}
示例2: FirstMatchingTag_returns_first_tag_that_matches_any_of_the_filters
public void FirstMatchingTag_returns_first_tag_that_matches_any_of_the_filters()
{
var account1 = new Account(1, "Halifax - SIF ISA", AccountType.Asset);
var account2 = new Account(2, "HSBC - Savings", AccountType.Asset);
account1.AddTag(_accountTag1);
account1.AddTag(_accountTag2);
account2.AddTag(_accountTag4);
account2.AddTag(_accountTag1);
var tagFilter = new System.Collections.Generic.List<AccountTag> {_accountTag1, _accountTag2};
var firstMatchingTag1 = account1.FirstMatchingTag(tagFilter);
var firstMatchingTag2 = account2.FirstMatchingTag(tagFilter);
Assert.AreEqual(_accountTag1, firstMatchingTag1);
Assert.AreEqual(_accountTag1, firstMatchingTag2);
}