Esempio n. 1
0
 public void parameters()
 {
     Student2 student = new Student2();
     // call by value
     double simpleGrade = 3.2;
     student.modifyGrade(simpleGrade);
     Assert.assertThat("simpleGrade should still be the same", simpleGrade == 3.2);
     student.modifyGrade(ref simpleGrade);
     Assert.assertThat("simpleGrade has now changed",simpleGrade == 0.0);
     Grade grade = new Grade(1.3, "programming");
     DateTime dateTimeBefore = grade.Date;
     student.addGrade(grade);
     Assert.assertThat("the date in grade has changed", grade.Date != dateTimeBefore);
 }
Esempio n. 2
0
 public void addGrade(Grade grade)
 {
     grade.Date = DateTime.Now;
 }