public void Init() { _diplomaRepository = new DiplomaRepository(); _requirementRepository = new RequirementRepository(); _studentRepository = new StudentRepository(); _tracker = new GraduationTrackerBLL(_requirementRepository); }
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()); }
public void Initialize() { GraduationTracker = new GraduationTracker(); DiplomaRepository = new DiplomaRepository(); StudentRepository = new StudentRepository(); }