public void TestIfUniCanAddAPaperThatAlreadyExistsInPaperDictionary() { University uni = new University(); Paper p = new Paper("Paper 101", 100101, "Paper Man"); Paper p2 = new Paper("Paper 101", 100101, "Paper Man"); uni.AddNewPaper(p); bool expected, actual; expected = true; actual = uni.CheckIfPaperAlreadyExists(p2.PaperID, p2.PaperName); Assert.AreEqual(expected, actual); }
public void TestGetPaperDictionary() { University uni = new University("A University"); Paper p = new Paper("Paper 101", 100101, "Paper Man"); uni.AddNewPaper(p); Dictionary <int, Paper> expected = new Dictionary <int, Paper> { }; expected.Add(100101, p); Dictionary <int, Paper> actual = uni.Papers; CollectionAssert.AreEqual(expected, actual); }
public void TestCannotEnrollAStudentDueToPaperConflict() { University uni = new University(); Student s = new Student("A Student", 111, DateTime.ParseExact("20/10/1974", "dd/MM/yyyy", null)); uni.AddNewStudent(s); Paper p = new Paper("Paper 101", 100101, "Paper Man"); uni.AddNewPaper(p); uni.EnrollAStudentInAPaper(s, p); bool expected, actual; expected = false; actual = uni.EnrollAStudentInAPaper(s, p); Assert.AreEqual(expected, actual); }