protected override void Execute(object sender, EventArgs args) {
    if(! _failedTestCriterion.IsEmpty ) {
       var testRun = new TestRun(_failedTestCriterion);
       RecipeFactory.Current.RunTests(testRun);
    }
 }
      public void SelectingNoneIncludesAll() {
         RecipeFactory.Type = typeof(ASpecialRecipe);
         var recipe = RecipeFactory.NewRecipe(string.Empty);
         _fc.ResetAllCategories();

         var testRun = new TestRun(new AllTestsCriterion());
         recipe.RunTests(testRun);
         
         ISelector registeredFilter = null;
         foreach(var filter in recipe.Selectors) {
            if(filter.Equals(_fc.Filter)) {
               registeredFilter = filter;
               break;
            }
         }
// ReSharper disable PossibleNullReferenceException
         Assert.True(registeredFilter.Includes(new ASpecialTestMethod("Blue")));
// ReSharper restore PossibleNullReferenceException
         Assert.True(registeredFilter.Includes(new ASpecialTestMethod("Red")));
         Assert.True(registeredFilter.Includes(new ASpecialTestMethod("Green")));
      }
Beispiel #3
0
      private void MainForm_Load(object sender, EventArgs e) {
         var config = new ConfigCurrentUser();
         Location = config.MainFormLocation;
         Size = config.MainFormSize;

         Command.CreateCommands(this, _csUnitControl);
         Command.FillToolStrip(_toolStrip);

         if( _clh.HasOption("recipe") ) {
            if( Utils.FileExists(_clh.GetOptionValueFor("recipe"), true)) {
               RecipeFactory.Load(_clh.GetOptionValueFor("recipe"));
            }
         }
         else if( _clh.HasOption("assembly") ) {
            if( Utils.FileExists(_clh.GetOptionValueFor("assembly"), true)) {
               var assemblyPathName = _clh.GetOptionValueFor("assembly");
               if( !Path.IsPathRooted(assemblyPathName) ) {
                  assemblyPathName = Path.Combine(Environment.CurrentDirectory, assemblyPathName);
               }
               RecipeFactory.Current.AddAssembly(assemblyPathName);
            }
         }
         else switch(config.StartupLoadItem) {
            case "Recipe":
               if(   config.RecentRecipies.Count > 0
                     && Utils.FileExists(config.RecentRecipies[0], true) ) {
                  RecipeFactory.Load(config.RecentRecipies[0]);
               }
               break;
            case "Assembly":
               if(   config.RecentAssemblies.Count > 0
                     && Utils.FileExists(config.RecentAssemblies[0], true)) {
                  RecipeFactory.Current.AddAssembly(config.RecentAssemblies[0]);
               }
               break;
         }
         
         // Setup the xml handler
         if( _clh.HasOption("xml") ) {
            _xmlWriter = new DefaultXmlWriter(RecipeFactory.Current, _clh.GetOptionValueFor("xml"));
         }

         // Automatically start the recipe
         if( _clh.HasOption("autorun") ) {
            if(RecipeFactory.Current != null) {
               var testRun = new TestRun(new AllTestsCriterion());
               RecipeFactory.Current.RunTests(testRun);
            }
         }
      }
 protected override void Execute(object sender, EventArgs args) {
    if(RecipeFactory.Current != null) {
       if(!RecipeFactory.Current.TestsRunning) {
          ITestRun selection = new TestRun(new AllTestsCriterion());
          RecipeFactory.Current.RunTests(selection);
       }
    }
 }
 protected override void Execute(object sender, EventArgs args) {
    if(RecipeFactory.Current != null) {
       var setCriterion = new MultipleTestsCriterion();
       foreach (var item in CsUnitControl.SelectedItems) {
          var uiElemInfo = item;
          if (uiElemInfo != null) {
             setCriterion.Add(uiElemInfo.AssemblyName, uiElemInfo.FixtureName, uiElemInfo.MethodName);
          }
       }
       var testRun = new TestRun(setCriterion);
       RecipeFactory.Current.RunTests(testRun);
    }
 }