Example #1
0
 public void should_get_total_score_except_unregisted_courses()
 {
     var transcript = new Transcript
     {
         Name = "Li Lei",
         Chinese = 80,
         English = 80
     };
     Assert.AreEqual(160, transcript.TotalScore);
 }
Example #2
0
 public void should_get_total_score()
 {
     var transcript = new Transcript
     {
         Name = "Li Lei",
         Chinese = 80,
         English = 80,
         Math = 80
     };
     Assert.AreEqual(240, transcript.TotalScore);
 }
Example #3
0
 public static List<Transcript> ToTranscripts(this ExamResult result)
 {
     return result.Results.Select(g =>
                                      {
                                          var transcript = new Transcript {Name = g.Name};
                                          transcript.GetType().GetProperties().
                                              First(p => p.Name == result.Course).
                                              SetValue(transcript, g.Score, null);
                                          return transcript;
                                      }).ToList();
 }
Example #4
0
 public void should_merge_valid_score_to_transcript()
 {
     var transcript = new Transcript
     {
         Name = "Li Lei",
         Chinese = 80,
         English = 81
     };
     var other = new Transcript
     {
         Name = "Li Lei",
         Math = 90
     };
     transcript.Merge(other);
     Assert.AreEqual(80, transcript.Chinese);
     Assert.AreEqual(81, transcript.English);
     Assert.AreEqual(90, transcript.Math);
 }
Example #5
0
 public void should_print_all_the_score_of_courses()
 {
     var transcript = new Transcript
     {
         Name = "Li Lei",
         Chinese = 80,
         English = 81,
         Math = 82
     };
     Assert.AreEqual("Name: Li Lei, Chinese: 80, English: 81, Math: 82", transcript.Print());
 }
Example #6
0
 public void should_print_all_the_score_of_courses_except_unregisted_courses()
 {
     var transcript = new Transcript
     {
         Name = "Li Lei",
         Chinese = 80,
         English = 81
     };
     Assert.AreEqual("Name: Li Lei, Chinese: 80, English: 81", transcript.Print());
 }