コード例 #1
0
        public void SalaryCalcSales()
        {
            // Sales
            // bonusYearPercent = 0.01,
            // maxBonusPercent = 0.35,
            // firstLevelSubordinariesBonusPercent = 0.003;

            IEmployee employee1 = new Employee("NameEmployee1", new DateTime(2017, 3, 3), 1000); // 1030
            IEmployee employee2 = new Employee("NameEmployee2", new DateTime(2017, 3, 3), 1000); // 1030
            IBoss     manager   = new Manager("NameManager", new DateTime(2015, 4, 4), 1000);    // 1160

            manager.SubordinateEmployees.Add(employee1, employee2);
            IBoss sales = new Sales("NameSales", new DateTime(2013, 5, 5), 1000);

            sales.SubordinateEmployees.Add(manager);

            double expected = 1056; // 1000 + (5 years * 0.01 * 1000) + (1030 + 1030 + 1155.2) * 0.003

            Assert.That(Math.Round(sales.CalcSalary()), Is.EqualTo(expected));
        }