public void TestGradeprofile() { //Arrange int[] TestMarks = new int[] { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; converter.Marks = TestMarks; //Act converter.CalculateGradeProfile(); bool expectedProfile; expectedProfile = ((converter.GradeProfile[0] == 0) && (converter.GradeProfile[1] == 3) && (converter.GradeProfile[2] == 1) && (converter.GradeProfile[3] == 1) && (converter.GradeProfile[4] == 1) && (converter.GradeProfile[5] == 4)); //Assert Assert.IsTrue(expectedProfile); }
public void TestCalculateGradeProfiles() { converter.Grades = new Grades[] { //Grade F (Grades)0, (Grades)0, //Grade D (Grades)0, (Grades)1, //Grade C (Grades)2, (Grades)3, //Grade B (Grades)4, (Grades)4, //Grade A (Grades)4, (Grades)4, }; double[] expectedGradeProfiles = new double[] { 30, 10, 10, 10, 40 }; converter.CalculateGradeProfile(); //Testing the items of the expected array items // and the actual array items are they equal CollectionAssert.AreEqual(converter.GradeProfile, expectedGradeProfiles); }
public void TestGradeProfile() { converter.Marks = StatsMarks; bool expectedProfile = false; converter.CalculateGradeProfile(); expectedProfile = ((converter.GradeProfile[0] == 3) && (converter.GradeProfile[1] == 1) && (converter.GradeProfile[2] == 1) && (converter.GradeProfile[3] == 1) && (converter.GradeProfile[4] == 4)); Assert.IsTrue(expectedProfile); }
public void TestGradeProfile() { studentGrades.Marks = testMarks; studentGrades.CalculateGradeProfile(); bool expectedProfile; expectedProfile = (studentGrades.GradeProfile[0] == 0) && ((studentGrades.GradeProfile[1] == 3) && (studentGrades.GradeProfile[2] == 1) && (studentGrades.GradeProfile[3] == 1) && (studentGrades.GradeProfile[4] == 1) && (studentGrades.GradeProfile[5] == 4)); Assert.IsTrue(expectedProfile); }
public void TestGradeProfile() { // Arrange converter.Marks = StatsMarks; // Act converter.CalculateGradeProfile(); bool expectedProfile; expectedProfile = ((converter.GradeProfile[0] == 3) && (converter.GradeProfile[1] == 1) && (converter.GradeProfile[2] == 1) && (converter.GradeProfile[3] == 1) && (converter.GradeProfile[4] == 4)); // Assert Assert.IsTrue(expectedProfile); }
public void TestGradeProfile() { //Arange studentGrades.Marks = StatsMarks; bool expectedProfile = false; //Act studentGrades.CalculateGradeProfile(); expectedProfile = ((studentGrades.GradeProfile[0] == 3) && (studentGrades.GradeProfile[1] == 1) && (studentGrades.GradeProfile[2] == 1) && (studentGrades.GradeProfile[3] == 1) && (studentGrades.GradeProfile[4] == 4)); //Assert Assert.IsTrue(expectedProfile); }
public void TestGradeProfile() { // 1. Arrange studentGrades.Marks = testMarks; // 2. Act studentGrades.CalculateGradeProfile(); bool expectedProfile = studentGrades.GradeProfile[0] == 0 && studentGrades.GradeProfile[1] == 3 && studentGrades.GradeProfile[2] == 1 && studentGrades.GradeProfile[3] == 1 && studentGrades.GradeProfile[4] == 1 && studentGrades.GradeProfile[5] == 4; // 3. Assert Assert.IsTrue(expectedProfile); }
public void TestGradeProfile() { // Arrange studentGradeTester.Marks = testMarks; // Act studentGradeTester.CalculateGradeProfile(); bool expectedProfile; expectedProfile = ((studentGradeTester.GradeProfile[0] == 3) && (studentGradeTester.GradeProfile[1] == 1) && (studentGradeTester.GradeProfile[2] == 1) && (studentGradeTester.GradeProfile[3] == 1) && (studentGradeTester.GradeProfile[4] == 4)); // Assert Assert.IsTrue(expectedProfile); }
// GET: Students public async Task <IActionResult> Analyse() { var students = await _context.Students.ToListAsync(); StudentGrades grades = new StudentGrades(); grades.Students = new string[students.Count]; grades.Marks = new int[students.Count]; int index = 0; foreach (Student student in students) { grades.Students[index] = student.Name; grades.Marks[index] = student.Mark; index++; } grades.CalculateStats(); grades.CalculateGradeProfile(); return(View(grades)); }