Ejemplo n.º 1
0
        public void Run()
        {
            Type[] types = reflectionUtility.LoadTypesWithAttribute <WrittenByAttribute>("SamuraiDojo.Test");

            foreach (Type type in types)
            {
                RunTests(type);
            }
        }
Ejemplo n.º 2
0
 private void AssignSenseisToBattles()
 {
     // Load up all of the battles, assign their sensei, and send to the repository
     Type[] types = reflectionUtility.LoadTypesWithAttribute <BattleAttribute>("SamuraiDojo");
     foreach (Type type in types)
     {
         IBattleAttribute battle = attributeUtility.GetAttribute <BattleAttribute>(type);
         ISenseiAttribute sensei = attributeUtility.GetAttribute <SenseiAttribute>(type);
         battleRepository.CreateBattle(battle, sensei);
     }
 }
Ejemplo n.º 3
0
        private void Load()
        {
            Type[] battleTypes =
                reflectionUtility.LoadTypesWithAttribute <BattleAttribute>("SamuraiDojo")
                .Where(type => !attributeUtility.HasAttribute <WrittenByAttribute>(type))
                .OrderByDescending(type => attributeUtility.GetAttribute <BattleAttribute>(type).Deadline).ToArray();

            for (int i = 0; i < battleTypes.Length; i++)
            {
                IBattleAttribute battleAttribute = attributeUtility.GetAttribute <BattleAttribute>(battleTypes[i]);
                battleAttribute.Type = battleTypes[i];
                All.Add(battleAttribute);
            }
        }