コード例 #1
0
ファイル: Portfolio.cs プロジェクト: GregorioF/Ingrenieria-I-
        public static Portfolio createWith(SummarizingAccount anAccount)
        {
            Portfolio portfolio = new Portfolio();

            portfolio.add(anAccount);

            return(portfolio);
        }
コード例 #2
0
 public List <AccountTransaction> transactionsOf(SummarizingAccount account)
 {
     if (!manages(account))
     {
         throw new Exception(ACCOUNT_NOT_MANAGED);
     }
     return(account.transactions());
 }
コード例 #3
0
ファイル: Portfolio.cs プロジェクト: GregorioF/Ingrenieria-I-
        public void add(SummarizingAccount account)
        {
            if (manages(account))
            {
                throw new Exception(ACCOUNT_ALREADY_MANAGED);
            }

            this.summarizingAccounts.Add(account);
        }
コード例 #4
0
        public static Portfolio createWith(SummarizingAccount anAccount1, SummarizingAccount anAccount2)
        {
            List <SummarizingAccount> accounts = new List <SummarizingAccount>()
            {
                anAccount1, anAccount2
            };

            return(Portfolio.createWith(accounts));
        }
コード例 #5
0
        public bool manages(SummarizingAccount account)
        {
            if (account == this)
            {
                return(true);
            }

            bool res = false;

            m_accounts.ForEach(acount => res = acount.manages(account) || res);
            return(res);
        }
コード例 #6
0
 public bool manages(SummarizingAccount account)
 {
     throw new Exception();
 }
コード例 #7
0
 public List <AccountTransaction> transactionsOf(SummarizingAccount account)
 {
     throw new Exception();
 }
コード例 #8
0
 public static Portfolio createWith(SummarizingAccount anAccount1, SummarizingAccount anAccount2)
 {
     throw new Exception();
 }
コード例 #9
0
ファイル: Portfolio.cs プロジェクト: GregorioF/Ingrenieria-I-
 public bool manages(SummarizingAccount account)
 {
     return(this == account || summarizingAccounts.Any(summarizingAccount => summarizingAccount.manages(account)));
 }
コード例 #10
0
 public bool manages(SummarizingAccount account)
 {
     return(this == account);
 }