Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }