public void RequiredCourseEquality() { RequiredCourse course1 = new RequiredCourse() { ID = 1, courseID = 1 }; RequiredCourse course2 = new RequiredCourse() { ID = 1, courseID = 2 }; Assert.AreEqual(course1, course2); }
public override bool Equals(object obj) { RequiredCourse course = obj as RequiredCourse; if (course != null) { if (course.ID == ID) { return(true); } return(false); } return(base.Equals(obj)); }
/// <summary> /// @russfeld /// This uses AJAX to return the HTML code for a new required course row on the form /// Mad props to http://ivanz.com/2011/06/16/editing-variable-length-reorderable-collections-in-asp-net-mvc-part-1/ /// </summary> /// <returns></returns> public ActionResult RequiredCourseRow(int id = 0) { if (id > 0) { RequiredCourse reqcourse = new RequiredCourse() { degreeProgramID = id, courseID = -1, semester = 1 }; return PartialView("RequiredCourseFormPartial", reqcourse); } else { return PartialView("RequiredCourseFormPartial"); } }