public void TestingPossibleScore() { List <int> scores = new List <int> { 33, 78, 42, 69, 50 }; Assert.AreEqual(SubmitAssignment.calcPossibleScore(scores), 272, "Calculation Error"); }
public void TestcalcPossibleScoreWithNegatives() { //Test if Possible Score still calculates with a negative List <int> scores = new List <int> { -1, 89, 77, 32, 10 }; Assert.AreEqual(SubmitAssignment.calcPossibleScore(scores), 207, "Calculation Error - Negatives"); }
public int getPossibleScore() { List <SubmitAssignment> arr = _context.SubmitAssignments.ToList(); arr = arr.Where(x => x.CourseID == HttpContext.Session.GetInt32("CourseID")).ToList(); arr = arr.Where(x => x.UserID == HttpContext.Session.GetInt32("UserID")).ToList(); List <int> func = new List <int>(); foreach (SubmitAssignment item in arr) { func.Add(item.maxPoints); } return(SubmitAssignment.calcPossibleScore(func)); }