Example #1
0
        public void A_violation_of_SRP_can_expose_code_to_more_defects_and_create_more_work()
        {
            Violating.Person parent    = new Violating.Person();
            Violating.Person principle = new Violating.Person();
            Violating.Person student   = new Violating.Person();
            Violating.Person teacher   = new Violating.Person();

            var people = new[] { parent, student, principle, teacher };

            NotifyAbsences(people);

            var grades = DoesMathGradeQualify(student);
        }
Example #2
0
        private bool DoesMathGradeQualify(Violating.Person student)
        {
            var grade = student.GetGrade("Math");

            if (grade == null)
            {
                return(false);
            }
            if (grade == "A")
            {
                return(true);
            }

            return(false);
        }