public void BalanceInTermTestSpringWithReduction()
        {
            //arrange
            var tc      = new TeacherController();
            var teacher = new Teacher()
            {
                TeacherId             = 1,
                TeacherName           = "Teacher",
                TotalPercentageSpring = 1,
                TeacherDateOfBirth    = new DateTime(1950, 01, 01),
                TeacherReduction      = new List <TeacherReduction>
                {
                    new TeacherReduction()
                    {
                        Term       = Terms.Spring,
                        Percentage = 0.2
                    }
                },
                CourseTeacher = new List <CourseTeacher>()
                {
                    new CourseTeacher
                    {
                        TeacherId          = 1,
                        Hours              = 100,
                        CourseOccurrenceId = 1,
                        CourseOccurrence   = new CourseOccurrence
                        {
                            Term = Terms.Spring,
                            Year = "2017/2018"
                        }
                    },
                    new CourseTeacher
                    {
                        TeacherId          = 1,
                        Hours              = 100,
                        CourseOccurrenceId = 2,
                        CourseOccurrence   = new CourseOccurrence
                        {
                            Term = Terms.Spring,
                            Year = "2017/2018"
                        }
                    }
                }
            };


            var allocated = 200;
            var available = Math.Round((double)(1700 / 2) * (1 - 0.2), 0, MidpointRounding.AwayFromZero);

            var target = available - allocated;

            //act
            var result = tc.BalanceInTerm(teacher, Terms.Spring);

            //assert
            Assert.AreEqual(target, result);
        }
        public void BalanceInTermTestFallNegativeBalance()
        {
            //arrange
            var tc      = new TeacherController();
            var teacher = new Teacher()
            {
                TeacherId           = 1,
                TeacherName         = "Teacher",
                TotalPercentageFall = 1,
                TeacherDateOfBirth  = new DateTime(1950, 01, 01),
                CourseTeacher       = new List <CourseTeacher>()
                {
                    new CourseTeacher
                    {
                        TeacherId          = 1,
                        Hours              = 500,
                        CourseOccurrenceId = 1,
                        CourseOccurrence   = new CourseOccurrence
                        {
                            Term = Terms.Fall,
                            Year = "2017/2018"
                        }
                    },
                    new CourseTeacher
                    {
                        TeacherId          = 1,
                        Hours              = 500,
                        CourseOccurrenceId = 2,
                        CourseOccurrence   = new CourseOccurrence
                        {
                            Term = Terms.Fall,
                            Year = "2017/2018"
                        }
                    }
                }
            };


            var allocated = 1000;
            var available = 1700 / 2;

            var target = available - allocated;

            //act
            var result = tc.BalanceInTerm(teacher, Terms.Fall);

            //assert
            Assert.AreEqual(target, result);
        }