public void Init()
		{
			base.InitBase();
			
			project = new MockCSharpProject();
			MockBuildProjectBeforeTestRun buildProject = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProject);
			
			classToTest = MockClass.CreateMockClassWithoutAnyAttributes();
			classToTest.SetDotNetName("MyTestClass");
			
			treeView = new MockTestTreeView();
			treeView.SelectedProject = project;
			treeView.SelectedClass = classToTest;
			
			runTestCommand.Owner = treeView;
			
			runTestCommand.Run();
			
			buildProject.FireBuildCompleteEvent();
			
			TestResult result = new TestResult("MyTestClass");
			result.ResultType = TestResultType.Success;
			context.MockTestResultsMonitor.FireTestFinishedEvent(result);
			
			runTestCommand.CallTestsCompleted();
		}
		public void Init()
		{
			base.InitBase();
			
			project1 = new MockCSharpProject();
			testProject1 = 
				TestProjectHelper.CreateTestProjectWithTestClassAndSingleTestMethod(project1, "testClass1", "testMethod1");
			
			project2 = new MockCSharpProject();
			testProject2 = 
				TestProjectHelper.CreateTestProjectWithTestClassAndSingleTestMethod(project1, "testClass2", "testMethod2");

			context.MockUnitTestsPad.AddProject(project1);
			context.MockUnitTestsPad.AddProject(project2);
			context.MockUnitTestsPad.AddTestProject(testProject1);
			context.MockUnitTestsPad.AddTestProject(testProject2);
			
			buildProject1 = new MockBuildProjectBeforeTestRun();
			
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProject1);
			
			runTestCommand.Run();
			
			buildProject1.FireBuildCompleteEvent();
			runTestCommand.CallTestsCompleted();
		}
		public void Init()
		{
			base.InitBase();
			
			project = new MockCSharpProject();
			MockBuildProjectBeforeTestRun buildProject = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProject);
			
			methodToTest = MockMethod.CreateMockMethodWithoutAnyAttributes();
			methodToTest.FullyQualifiedName = "MyTests.MyTestClass.MyTestMethod";
			
			classToTest = methodToTest.DeclaringType as MockClass;
			classToTest.SetDotNetName("MyTests.MyTestClass");
			
			treeView = new MockTestTreeView();
			treeView.SelectedProject = project;
			treeView.SelectedMember = methodToTest;
			
			runTestCommand.Owner = treeView;
			
			runTestCommand.Run();
			
			buildProject.FireBuildCompleteEvent();
			
			context.MockUnitTestWorkbench.MakeSafeThreadAsyncMethodCallsWithArguments = true;
			context.MockBuildOptions.ShowErrorListAfterBuild = false;
			
			TestResult result = new TestResult("MyTests.MyTestClass.MyTestMethod");
			result.ResultType = TestResultType.Failure;
			context.MockTestResultsMonitor.FireTestFinishedEvent(result);
			
			runTestCommand.CallTestsCompleted();
		}
		public void Init()
		{
			factory = new MockBuildProjectFactory();
			project = new MockCSharpProject();
			buildProject = new MockBuildProjectBeforeTestRun();
			factory.AddBuildProjectBeforeTestRun(buildProject);
			
			createdBuildProject = factory.CreateBuildProjectBeforeTestRun(new[] { project }) as MockBuildProjectBeforeTestRun;
		}
		public void Init()
		{
			base.InitBase();
			
			project = new MockCSharpProject();
			context.MockUnitTestsPad.AddProject(project);
			
			string[] methodNames = new string[] { "FirstTest", "SecondTest", "ThirdTest" };
			
			testProject = 
				TestProjectHelper.CreateTestProjectWithTestClassTestMethods(project,
					"MyTests.MyTestClass",
					methodNames);
			
			TestClass testClass = testProject.TestClasses[0];
			firstTestMethod = testClass.Members[0];
			secondTestMethod = testClass.Members[1];
			thirdTestMethod = testClass.Members[2];
			
			context.MockUnitTestsPad.AddTestProject(testProject);
			
			MockBuildProjectBeforeTestRun buildProjectBeforeTestRun = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProjectBeforeTestRun);
			
			context.UnitTestingOptions.NoThread = true;
			context.UnitTestingOptions.NoShadow = true;
			context.UnitTestingOptions.NoLogo = true;
			context.UnitTestingOptions.NoDots = true;
			context.UnitTestingOptions.Labels = true;
			context.UnitTestingOptions.CreateXmlOutputFile = true;
			
			testFramework = new MockTestFramework();
			context.MockRegisteredTestFrameworks.AddTestFrameworkForProject(project, testFramework);
			
			runTestCommand.Run();
			
			buildProjectBeforeTestRun.FireBuildCompleteEvent();
			
			errorTestResult = new TestResult("MyTests.MyTestClass.FirstTest");
			errorTestResult.ResultType = TestResultType.Failure;
			
			warningTestResult = new TestResult("MyTests.MyTestClass.SecondTest");
			warningTestResult.ResultType = TestResultType.Ignored;
			
			successTestResult = new TestResult("MyTests.MyTestClass.ThirdTest");
			successTestResult.ResultType = TestResultType.Success;
			
			context.MockUnitTestWorkbench.MakeSafeThreadAsyncMethodCallsWithArguments = true;
			MockTestRunner testRunner = runTestCommand.TestRunnersCreated[0];
			testRunner.FireTestFinishedEvent(errorTestResult);
			testRunner.FireTestFinishedEvent(warningTestResult);
			testRunner.FireTestFinishedEvent(successTestResult);
			
			context.MockUnitTestsPad.IsUpdateToolbarMethodCalled = false;
			runningTestsBeforeTestsFinishedCalled = AbstractRunTestCommand.IsRunningTest;
			runTestCommand.CallTestsCompleted();
		}
        public BuildProject CreateBuildProjectBeforeTestRun(IEnumerable <IProject> projects)
        {
            MockBuildProjectBeforeTestRun buildProject = RemoveBuildProjectInstance();

            if (buildProject != null)
            {
                buildProject.Projects = projects.ToArray();
            }
            return(buildProject);
        }
 MockBuildProjectBeforeTestRun RemoveBuildProjectInstance()
 {
     if (buildProjectInstances.Count > 0)
     {
         MockBuildProjectBeforeTestRun buildProject = buildProjectInstances[0];
         buildProjectInstances.RemoveAt(0);
         return(buildProject);
     }
     return(null);
 }
		public void Init()
		{
			base.InitBase();
			project = new MockCSharpProject();
			context.MockUnitTestsPad.AddProject(project);
			
			buildProjectBeforeTestRun = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProjectBeforeTestRun);
			
			context.MockTaskService.BuildMessageViewCategory.SetText("Previous build text...");
			context.UnitTestCategory.SetText("Previous unit test run...");
		}
		public void Init()
		{
			base.InitBase();
			
			project = new MockCSharpProject();
			MockBuildProjectBeforeTestRun buildProject = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProject);
			
			treeView = new MockTestTreeView();
			treeView.SelectedProject = project;
			treeView.SelectedNamespace = "MyNamespace";
			
			runTestCommand.Owner = treeView;
			runTestCommand.Run();
			buildProject.FireBuildCompleteEvent();
		}
		public void Init()
		{
			MockCSharpProject project = new MockCSharpProject();
			SelectedTests selectedTests = new SelectedTests(project);
			helper = new NUnitConsoleApplication(selectedTests);
			
			context = new MockRunTestCommandContext();
			context.MockUnitTestsPad.AddProject(project);
			
			buildProject = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProject);
			
			processRunner = new MockProcessRunner();
			
			testFramework = new MockNUnitTestFramework(processRunner, context.MockTestResultsMonitor, context.UnitTestingOptions);
			context.MockRegisteredTestFrameworks.AddTestFrameworkForProject(project, testFramework);
			
			runCommand = new DerivedRunTestInPadCommand(context);
		}
		public void Init()
		{
			InitBase();
			
			MockCSharpProject project1 = new MockCSharpProject();
			MockCSharpProject project2 = new MockCSharpProject();
			testFramework = new MockTestFramework();
			testFramework.IsBuildNeededBeforeTestRun = false;
			context.MockRegisteredTestFrameworks.AddTestFrameworkForProject(project1, testFramework);
			context.MockRegisteredTestFrameworks.AddTestFrameworkForProject(project2, testFramework);
			
			buildProjectBeforeTestRun = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProjectBeforeTestRun);
			
			context.MockUnitTestsPad.AddProject(project1);
			context.MockUnitTestsPad.AddProject(project2);
			
			runTestCommand.Run();
		}
		public void InitBase()
		{
			project = new MockCSharpProject();
			buildProject = new MockBuildProjectBeforeTestRun();
			
			context = new MockRunTestCommandContext();
			context.MockUnitTestsPad.AddProject(project);
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProject);
			
			debuggerService = new MockDebuggerService();
			testFramework = 
				new MockNUnitTestFramework(debuggerService,
					context.MockTestResultsMonitor,
					context.UnitTestingOptions,
					context.MessageService);
			context.MockRegisteredTestFrameworks.AddTestFrameworkForProject(project, testFramework);
			
			runCommand = new DerivedRunTestWithDebuggerCommand(context);
		}
		public void Init()
		{
			base.InitBase();
			
			MockCSharpProject project = new MockCSharpProject();
			context.MockUnitTestsPad.AddProject(project);
			
			buildProjectBeforeTestRun = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProjectBeforeTestRun);
			
			runTestCommand.Run();
			
			FileName fileName = new FileName("test.cs");
			context.MockTaskService.Add(new Task(fileName, String.Empty, 1, 1, TaskType.Error));
			
			BuildError error = new BuildError();
			buildProjectBeforeTestRun.LastBuildResults.Add(error);
			buildProjectBeforeTestRun.FireBuildCompleteEvent();
		}
		public void Init()
		{
			base.InitBase();
			
			MockCSharpProject project = new MockCSharpProject();
			context.MockUnitTestsPad.AddProject(project);
			
			buildProjectBeforeTestRun = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProjectBeforeTestRun);
			
			testFramework = new MockTestFramework();
			context.MockRegisteredTestFrameworks.AddTestFrameworkForProject(project, testFramework);
			
			runTestCommand.Run();
			
			context.MockUnitTestsPad.IsUpdateToolbarMethodCalled = false;
			isUpdatedToolbarMethodCalledBeforeStopMethodCalled = context.MockUnitTestsPad.IsUpdateToolbarMethodCalled;
			runTestCommand.Stop();
		}
		public void Init()
		{
			base.InitBase();
			
			project = new MockCSharpProject();
			MockBuildProjectBeforeTestRun buildProject = new MockBuildProjectBeforeTestRun();
			context.MockBuildProjectFactory.AddBuildProjectBeforeTestRun(buildProject);
			
			treeView = new MockTestTreeView();
			treeView.SelectedProject = project;
			
			runTestCommand.Owner = treeView;
			
			context.MockUnitTestsPad = null;
			runTestCommand.Run();
			
			context.MockUnitTestWorkbench.MakeSafeThreadAsyncMethodCallsWithArguments = true;
			TestResult testResult = new TestResult("MyTests.MyTestClass.UnknownTestMethod");
			testResult.ResultType = TestResultType.Failure;
			context.MockTestResultsMonitor.FireTestFinishedEvent(testResult);
		}
		public void AddBuildProjectBeforeTestRun(MockBuildProjectBeforeTestRun buildBeforeTestRun)
		{
			buildProjectInstances.Add(buildBeforeTestRun);
		}
 public void AddBuildProjectBeforeTestRun(MockBuildProjectBeforeTestRun buildBeforeTestRun)
 {
     buildProjectInstances.Add(buildBeforeTestRun);
 }