예제 #1
0
        public void CopyExperience()
        {
            Condition[] conditions = SetupConditions();

            Experience teacher = new Experience();
            Experience student = new Experience();

            Activity victory   = new Activity("Victory", null);
            Activity defeat    = new Activity("Defeat", null);
            Activity stalemate = new Activity("Stalemate", null);

            Condition[] victorySituation = new Condition[] { conditions[0], conditions[2], conditions[4] };
            teacher.AddSuccessfulExperience(victory, victorySituation);

            Condition[] defeatSituation = new Condition[] { conditions[1], conditions[3], conditions[5] };
            teacher.AddFailedExperience(defeat, defeatSituation);

            Condition[] otherSituation = new Condition[] { conditions[6], conditions[7], conditions[8] };
            teacher.AddExperience(stalemate, otherSituation);

            string teacherStatus = teacher.ToString();

            teacher.CopyRecentExperienceTo(student);

            string studentStatus = student.ToString();

            Assert.IsTrue(teacherStatus.Equals(studentStatus));
        }