コード例 #1
0
ファイル: Boss.cs プロジェクト: PlumpMath/DesignPatterns-245
        public void Review(IncomeBill bill)
        {
            var comments = bill.IncomeBeforeTax - bill.IncomeAfterTax > 50 ?
                           "From Boss: This amount is not allowed" : "From Boss: I am fine with it.";

            Console.WriteLine(comments);
        }
コード例 #2
0
        public void Review(IncomeBill bill)
        {
            var comments = bill.IncomeBeforeTax - bill.IncomeAfterTax < 50
                ? "From CPA: This amount is not reasonable"
                : "From CPA: I am fine with it.";

            Console.WriteLine(comments);
        }
コード例 #3
0
        private static AccountBook InitializeAccountBook()
        {
            var accountBook = new AccountBook();
            var income      = new IncomeBill {
                IncomeBeforeTax = 100, IncomeAfterTax = 70
            };

            accountBook.AttachBill(income);
            var consume = new ConsumeBill {
                Expense = 150
            };

            accountBook.AttachBill(consume);
            return(accountBook);
        }