Exemple #1
0
 public void SetUp()
 {
     StubTask.StartTimes = 0;
     mvcConfig = new MVCConfiguration();
     mvcConfig.ViewsManagerType = typeof(StubViewsManager);
     mvcConfig.TaskInfos[typeof(StubTask)] = ti = new TaskInfo();
     ti.ViewInfos = viewInfos;
     tm = new TasksManager(mvcConfig);
 }
Exemple #2
0
 private Navigator CreateNavigator(TaskInfo ti)
 {
     if (ti.NavigatorType != null)
         return CreateHelper.Create(ti.NavigatorType) as Navigator;
     else if (Config.NavigatorType != null)
         return CreateHelper.Create(Config.NavigatorType) as Navigator;
     else
         return new Navigator();
 }
        public override TaskInfo GetTaskInfo(Type taskType)
        {
            TaskInfo result = new TaskInfo();

            TaskAttribute ta = GetTaskAttribute(taskType);
            if (ta != null)
                result.NavigatorType = ta.NavigatorType;

            IList iPointInfWrappers = CreateIPointInfos(taskType, result.InteractionPoints);
            FillNavTargets(taskType, iPointInfWrappers, result.InteractionPoints);

            return result;
        }
        public override TaskInfo GetTaskInfo(Type taskType)
        {
            TaskInfo result = new TaskInfo();

            TaskAttribute ta = GetTaskAttribute(taskType);
            if (ta != null)
                result.NavigatorType = ta.NavigatorType;

            InteractionPointInfoWrapper[] iPointInfoWrappers = CreateInteractionPointInfos(
                                                        taskType, result.InteractionPoints);

            foreach (InteractionPointInfoWrapper iPointWrapper in iPointInfoWrappers)
                FillNavTargets(iPointWrapper, result.InteractionPoints);

            return result;
        }
        public void TestEnumerateAndCount()
        {
            TaskInfoCollection taskInfColl = new TaskInfoCollection();
            taskInfColl[typeof(int)] = new TaskInfo();
            taskInfColl[typeof(string)] = new TaskInfo();

            Assert.AreEqual(2, taskInfColl.Count);

            bool containsFirst = false, containsSecond = false;
            int count = 0;

            foreach (Type t in taskInfColl)
            {
                if (t == typeof(int))
                    containsFirst = true;
                else if (t == typeof(string))
                    containsSecond = true;
                count++;
            }

            Assert.IsTrue(containsFirst && containsSecond && (count == 2));
        }