Пример #1
0
 public void Init()
 {
     _diplomaRepository     = new DiplomaRepository();
     _requirementRepository = new RequirementRepository();
     _studentRepository     = new StudentRepository();
     _tracker = new GraduationTrackerBLL(_requirementRepository);
 }
Пример #2
0
        public void TestHasCredits()
        {
            Diploma diploma = new Diploma();

            Student[] students = new Student[] { };
            List <Tuple <bool, Standing> > graduated = new List <Tuple <bool, Standing> >();
            int i = 1;

            diploma = DiplomaRepository.GetById(i);

            int[] ids = new int[] { 1, 2, 3 };
            students = StudentRepository.All(ids).ToArray();

            foreach (Student student in students)
            {
                graduated.Add(GraduationTracker.HasGraduated(diploma, student));
            }
            Assert.IsTrue(graduated.Any());

            ids      = new int[] { 4 };
            students = StudentRepository.All(ids).ToArray();
            foreach (Student student in students)
            {
                graduated.Clear();
                graduated.Add(GraduationTracker.HasGraduated(diploma, student));
            }
            Assert.IsFalse(graduated.Any(g => g.Item1 == true));

            ids      = new int[] { 1, 4 };
            students = StudentRepository.All(ids).ToArray();
            foreach (Student student in students)
            {
                graduated.Clear();
                graduated.Add(GraduationTracker.HasGraduated(diploma, student));
            }
            Assert.IsTrue(graduated.Any());
        }
Пример #3
0
 public void Initialize()
 {
     GraduationTracker = new GraduationTracker();
     DiplomaRepository = new DiplomaRepository();
     StudentRepository = new StudentRepository();
 }