Beispiel #1
0
        /// <summary>
        /// Returns the default MVCConfiguration instance with
        /// <see cref="MVCConfiguration.ViewInfosProviderType"/> set to <see cref="DefaultViewInfosProvider"/>
        /// and <see cref="MVCConfiguration.TaskInfoProviderType"/> set to <see cref="DefaultTaskInfoProvider"/>
        /// and <see cref="MVCConfiguration.ViewsAssembly"/> pointing to the calling assembly.
        /// </summary>
        #endregion
        public static MVCConfiguration GetDefault()
        {
            MVCConfiguration result = new MVCConfiguration();

            result.viewInfosProviderType = typeof(DefaultViewInfosProvider);
            result.taskInfoProviderType  = typeof(DefaultTaskInfoProvider);
            result.ViewsAssembly         = Assembly.GetCallingAssembly();
            return(result);
        }
Beispiel #2
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);
 }
Beispiel #3
0
        public void TestViewInfosByTask_Advanced()
        {
            mvcConfig.ViewInfosProviderType = typeof(StubViewInfosProvider);
            mvcConfig.ViewsAssembly = StubViewInfosProvider.inputAssembly1;
            mvcConfig.ViewsAssemblies.Add(StubViewInfosProvider.inputAssembly2);
            mvcConfig.ViewsAssemblies.Add(StubViewInfosProvider.inputAssembly3);
            Assert.AreEqual(3, mvcConfig.ViewInfosByTask[typeof(int)].Count);
            Assert.AreSame(StubViewInfosProvider.vi1, mvcConfig.ViewInfosByTask[typeof(int)]["vi1"]);
            Assert.AreSame(StubViewInfosProvider.vi2, mvcConfig.ViewInfosByTask[typeof(int)]["vi2"]);
            Assert.AreSame(StubViewInfosProvider.vi3, mvcConfig.ViewInfosByTask[typeof(int)]["vi3"]);

            mvcConfig = new MVCConfiguration();
            mvcConfig.ViewInfosProviderType = typeof(StubViewInfosProvider);
            mvcConfig.ViewsAssemblies.Add(StubViewInfosProvider.inputAssembly2);
            Assert.AreEqual(1, mvcConfig.ViewInfosByTask[typeof(int)].Count);
            Assert.AreSame(StubViewInfosProvider.vi2, mvcConfig.ViewInfosByTask[typeof(int)]["vi2"]);
        }
Beispiel #4
0
 public static MVCConfiguration GetDefault()
 {
     MVCConfiguration result = new MVCConfiguration();
     result.viewInfosProviderType = typeof(DefaultViewInfosProvider);
     result.taskInfoProviderType = typeof(DefaultTaskInfoProvider);
     result.ViewsAssembly = Assembly.GetCallingAssembly();
     return result;
 }
Beispiel #5
0
 public void TestSetUp()
 {
     mvcConfig = new MVCConfiguration();
 }
Beispiel #6
0
 public TasksManager(MVCConfiguration mvcConfig)
 {
     this.Config = mvcConfig;
 }