public void ElectiveCourseEquality() { ElectiveCourse course1 = new ElectiveCourse() { ID = 1, electiveListID = 1 }; ElectiveCourse course2 = new ElectiveCourse() { ID = 1, electiveListID = 2 }; Assert.AreEqual(course1, course2); }
public override bool Equals(object obj) { ElectiveCourse course = obj as ElectiveCourse; 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 elective 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 ElectiveCourseRow(int id = 0) { if (id > 0) { ElectiveCourse elcourse = new ElectiveCourse() { degreeProgramID = id, electiveListID = -1, semester = 1, credits = 3, }; return PartialView("ElectiveCourseFormPartial", elcourse); } else { return PartialView("ElectiveCourseFormPartial"); } }