public void AddNullAlumniToAlumnusListShouldThrowArgumentNullException() { Alumni alumni = null; AlumnusList alumnus = new AlumnusList(); alumnus.AddAlumni(alumni); }
public void RemoveAddedAlumniFromAlumnusListShouldRemoveAlumni() { DateTime startDateTime = new DateTime(2015, 12, 12); DateTime gradDateTime = new DateTime(2016, 6, 6); Alumni alumni = new Alumni("PG192E1", "Phil", "Davids", gradDateTime, startDateTime); AlumnusList alumnus = new AlumnusList(); alumnus.AddAlumni(alumni); //verify alumni was added in the first place CollectionAssert.Contains(alumnus.Alumnus, alumni); Assert.AreEqual(true, alumnus.RemoveAlumni(alumni)); //verify alumni removed CollectionAssert.DoesNotContain(alumnus.Alumnus, alumni); }
public void AddAlumniUpdatesEmptyAlumnusWithNewAlumni() { DateTime startDateTime = new DateTime(2015, 12, 12); DateTime gradDateTime = new DateTime(2016, 6, 6); Alumni alumni = new Alumni("PG192E1", "Phil", "Davids", gradDateTime, startDateTime); AlumnusList alumnus = new AlumnusList(); alumnus.AddAlumni(alumni); CollectionAssert.Contains(alumnus.Alumnus, alumni); /* * Above line is equivalent to the following... * List<Alumni> alums = new List<Alumni>(); * alums.Add(alumni); * * CollectionAssert.AreEquivalent(alumnus.Alumnus, alums); */ }