/// <summary>
 /// Abstract out the creation of the new AssemblyTaskFactory with default task, and
 /// with some basic validation.
 /// </summary>
 private void SetupTaskFactory(IDictionary <string, string> factoryParameters, bool explicitlyLaunchTaskHost)
 {
     _taskFactory = new AssemblyTaskFactory();
     _loadInfo    = AssemblyLoadInfo.Create(null, Assembly.GetAssembly(typeof(TaskToTestFactories)).Location);
     _loadedType  = _taskFactory.InitializeFactory(_loadInfo, "TaskToTestFactories", new Dictionary <string, TaskPropertyInfo>(), string.Empty, factoryParameters, explicitlyLaunchTaskHost, null, ElementLocation.Create("NONE"), String.Empty);
     Assert.True(_loadedType.Assembly.Equals(_loadInfo)); // "Expected the AssemblyLoadInfo to be equal"
 }
 public void GoodTaskNameButNotInInfo()
 {
     Assert.Throws <InvalidProjectFileException>(() =>
     {
         AssemblyTaskFactory taskFactory = new AssemblyTaskFactory();
         taskFactory.InitializeFactory(_loadInfo, "RandomTask", new Dictionary <string, TaskPropertyInfo>(), string.Empty, null, false, null, ElementLocation.Create("NONE"), String.Empty);
     }
                                                 );
 }
 public void NullLoadInfo()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         AssemblyTaskFactory taskFactory = new AssemblyTaskFactory();
         taskFactory.InitializeFactory(null, "TaskToTestFactories", new Dictionary <string, TaskPropertyInfo>(), string.Empty, null, false, null, ElementLocation.Create("NONE"), String.Empty);
     }
                                           );
 }
Beispiel #4
0
        public void EmptyTaskName()
        {
            AssemblyTaskFactory taskFactory = new AssemblyTaskFactory();

            taskFactory.InitializeFactory(_loadInfo, String.Empty, new Dictionary <string, TaskPropertyInfo>(), string.Empty, null, false, null, ElementLocation.Create("NONE"), String.Empty);
        }