예제 #1
0
 public void Test_GivenJob_vs_JobDone()
 {
     Office office = new Office();
     int JobGiven = 0, JobDone = 0;
         office.CountDown();
         foreach (KeyValuePair<string, Report> pair in office.Employment.Where(emp => !emp.Key.StartsWith("Director")))
         {
             foreach (Responsibility resp in pair.Value.DischargeDuties)
             {
                 JobDone += (resp == Responsibility.None) ? 0 : 1;
             }
         }
         JobGiven = office.GivenTasks.Sum(x => x.Volume * office.Employees.Where(emp => emp.PositionTask.FirstOrDefault() == x.Responsibility).Count());
     Assert.AreEqual(JobGiven, JobDone, "Work issued by {0} man-hours, the work actually carried out on {1} man-hours", JobGiven, JobDone);
 }
예제 #2
0
 public PrintHelper(Office of)
 {
     office = of;
 }
 void bgworker_DoWork(object sender, DoWorkEventArgs e)
 {
     office = new Office();
     office.CountDown();
     office.CreateReport();
 }