public void TestThreeGradesDoubleExecute() { SchoolSubject math = new SchoolSubject { Name = "Mathe", }; math.Grades = new double[3]; math.Grades[0] = 3; math.Grades[1] = 2; math.Grades[2] = 4; var result = math.CalculateAverage(); result = math.CalculateAverage(); Assert.AreEqual(3, result); }
public void TestNoGrades() { SchoolSubject math = new SchoolSubject { Name = "Mathe", }; var result = math.CalculateAverage(); Assert.AreEqual(0, result); }
public void TestEmptyGrades() { SchoolSubject math = new SchoolSubject { Name = "Mathe", }; math.Grades = new double[4]; var result = math.CalculateAverage(); Assert.AreEqual(0, result); }
public void TestFourGrades() { SchoolSubject math = new SchoolSubject { Name = "Mathe", }; math.Grades = new double[4]; math.Grades[0] = 3; math.Grades[1] = 2; math.Grades[2] = 4; math.Grades[3] = 3; var result = math.CalculateAverage(); Assert.AreEqual(3, result); }