コード例 #1
0
		public MockNUnitTestFramework(IUnitTestDebuggerService debuggerService,
			ITestResultsMonitor testResultsMonitor, 
			UnitTestingOptions options,
			IMessageService messageService)
			: this(debuggerService, null, testResultsMonitor, options, messageService)
		{
		}
コード例 #2
0
		public CodeCoverageTestRunner(CodeCoverageTestRunnerContext context)
			: base(context)
		{
			this.options = context.Options;
			this.fileSystem = context.CodeCoverageFileSystem;
			settingsFactory = new PartCoverSettingsFactory(fileSystem);
		}
コード例 #3
0
		public void NoThreadSetToTrueInProperties()
		{
			Properties newProperties = new Properties();
			newProperties.Set<bool>(UnitTestingOptions.NoThreadProperty, true);
			UnitTestingOptions options = new UnitTestingOptions(newProperties);
			
			Assert.IsTrue(options.NoThread);
		}
コード例 #4
0
		public NUnitTestDebugger(IDebuggerService debuggerService,
			IMessageService messageService,
			ITestResultsReader testResultsReader,
			UnitTestingOptions options)
			: base(debuggerService, messageService, testResultsReader)
		{
			this.options = options;
		}
コード例 #5
0
		void CreateNUnitConsoleApplication()
		{
			MockCSharpProject project = new MockCSharpProject();
			selectedTests = new SelectedTests(project);
			
			options = new UnitTestingOptions(new Properties());
			nunitConsoleApp = new NUnitConsoleApplication(selectedTests, options);
		}
コード例 #6
0
 public NUnitTestDebugger(IUnitTestDebuggerService debuggerService,
                          IUnitTestMessageService messageService,
                          ITestResultsMonitor testResultsMonitor,
                          UnitTestingOptions options)
     : base(debuggerService, messageService, testResultsMonitor)
 {
     this.options = options;
 }
コード例 #7
0
		public DerivedCodeCoverageTestRunner(IUnitTestProcessRunner processRunner,
			ITestResultsMonitor testResultsMonitor,
			UnitTestingOptions options,
			IFileSystem fileSystem,
			IUnitTestMessageService messageService)
			: base(new CodeCoverageTestRunnerContext(processRunner, testResultsMonitor, fileSystem, messageService, options))
		{
		}
コード例 #8
0
		public NUnitTestDebugger(IUnitTestDebuggerService debuggerService,
			IUnitTestMessageService messageService,
			ITestResultsMonitor testResultsMonitor,
			UnitTestingOptions options)
			: base(debuggerService, messageService, testResultsMonitor)
		{
			this.options = options;
		}
コード例 #9
0
 public NUnitTestDebugger(IDebuggerService debuggerService,
                          IMessageService messageService,
                          ITestResultsReader testResultsReader,
                          UnitTestingOptions options)
     : base(debuggerService, messageService, testResultsReader)
 {
     this.options = options;
 }
コード例 #10
0
		public void Init()
		{
			processRunner = new MockProcessRunner();
			testResultsMonitor = new MockTestResultsMonitor();
			options = new UnitTestingOptions(new Properties());
			fileSystem = new MockFileSystem();
			messageService = new MockMessageService();
			testRunner = new DerivedCodeCoverageTestRunner(processRunner, testResultsMonitor, options, fileSystem, messageService);
		}
コード例 #11
0
		void CreateNUnitConsoleApplication()
		{
			project = new MockCSharpProject();
			project.FileName = FileName.Create(@"c:\projects\MyTests\MyTests.csproj");
			
			var testProject = new NUnitTestProject(project);
			options = new UnitTestingOptions(new Properties());
			nunitConsoleApp = new NUnitConsoleApplication(new [] { testProject }, options);
		}
コード例 #12
0
		public CodeCoverageTestRunnerContext(IUnitTestProcessRunner processRunner,
			ITestResultsMonitor testResultsMonitor,
			ICSharpCode.CodeCoverage.IFileSystem fileSystem,
			IUnitTestMessageService messageService,
			UnitTestingOptions options)
			: base(processRunner, testResultsMonitor, fileSystem, messageService)
		{
			this.options = options;
		}
コード例 #13
0
		public MockNUnitTestFramework(IUnitTestDebuggerService debuggerService,
			IUnitTestProcessRunner processRunner,
			ITestResultsMonitor testResultsMonitor, 
			UnitTestingOptions options,
			IMessageService messageService)
		{
			this.debuggerService = debuggerService;
			this.processRunner = processRunner;
			this.testResultsMonitor = testResultsMonitor;
			this.options = options;
			this.messageService = messageService;
		}
コード例 #14
0
		void InitializeOptions(UnitTestingOptions options)
		{
			NoThread = options.NoThread;
			NoLogo = options.NoLogo;
			NoDots = options.NoDots;
			Labels = options.Labels;
			ShadowCopy = !options.NoShadow;
			
			if (options.CreateXmlOutputFile) {
				GenerateXmlOutputFileName();
			}
		}
コード例 #15
0
        void InitializeOptions(UnitTestingOptions options)
        {
            NoThread   = options.NoThread;
            NoLogo     = options.NoLogo;
            NoDots     = options.NoDots;
            Labels     = options.Labels;
            ShadowCopy = !options.NoShadow;

            if (options.CreateXmlOutputFile)
            {
                GenerateXmlOutputFileName();
            }
        }
コード例 #16
0
		public MockCodeCoverageTestRunnerFactory()
		{
			ProcessRunner = new MockProcessRunner();
			TestResultsMonitor = new MockTestResultsMonitor();
			Options = new UnitTestingOptions(new Properties());
			FileSystem = new MockFileSystem();
			CodeCoverageTestRunnerContext context = new CodeCoverageTestRunnerContext(ProcessRunner, 
				TestResultsMonitor, 
				FileSystem, 
				MessageService,
				Options);
			TestRunner = new CodeCoverageTestRunner(context);
		}
コード例 #17
0
		public void Init()
		{
			selectedTests = SelectedTestsHelper.CreateSelectedTestMember();
			FileUtility.ApplicationRootPath = @"C:\SharpDevelop";
			
			messageService = new MockMessageService();
			debuggerService = new MockDebuggerService();
			debugger = debuggerService.MockDebugger;
			testResultsMonitor = new MockTestResultsMonitor();
			testResultsMonitor.FileName = @"c:\temp\tmp66.tmp";
			options = new UnitTestingOptions(new Properties());
			options.NoShadow = true;
			testDebugger = new NUnitTestDebugger(debuggerService, messageService, testResultsMonitor, options);
		}
コード例 #18
0
        /// <summary>
        /// Runs the test for the project after a successful build.
        /// </summary>
        void OnBuildComplete(BuildResults results, IProject project, string namespaceFilter, IClass fixture, IMember test)
        {
            if (results.ErrorCount == 0 && IsRunningTest)
            {
                UnitTestApplicationStartHelper helper = new UnitTestApplicationStartHelper();

                UnitTestingOptions options = new UnitTestingOptions();
                helper.NoThread   = options.NoThread;
                helper.NoLogo     = options.NoLogo;
                helper.NoDots     = options.NoDots;
                helper.Labels     = options.Labels;
                helper.ShadowCopy = !options.NoShadow;

                if (options.CreateXmlOutputFile)
                {
                    helper.XmlOutputFile = Path.Combine(Path.GetDirectoryName(project.OutputAssemblyFullPath), project.AssemblyName + "-TestResult.xml");
                }

                helper.Initialize(project, namespaceFilter, fixture, test);
                helper.Results = Path.GetTempFileName();

                ResetTestResults(project);

                testResultsMonitor.FileName = helper.Results;
                testResultsMonitor.Start();

                try {
                    RunTests(helper);
                } catch {
                    StopMonitoring();
                    throw;
                }
            }
            else
            {
                if (IsRunningTest)
                {
                    Stop();
                }
                if (TaskService.SomethingWentWrong && ErrorListPad.ShowAfterBuild)
                {
                    ShowErrorList();
                }
            }
        }
コード例 #19
0
		public void SetUp()
		{
			Properties p = new Properties();
			options = new UnitTestingOptions(p);
			options.Labels = true;
			options.NoDots = false;
			options.NoShadow = false;
			options.NoThread = false;
			options.CreateXmlOutputFile = false;
			
			panel = new DerivedUnitTestingOptionsPanel(options);
			panel.LoadPanelContents();
			
			labelsCheckBox = (CheckBox)panel.ControlDictionary["labelsCheckBox"];
			showLogoCheckBox = (CheckBox)panel.ControlDictionary["showLogoCheckBox"];
			showProgressCheckBox = (CheckBox)panel.ControlDictionary["showProgressCheckBox"];
			threadCheckBox = (CheckBox)panel.ControlDictionary["threadCheckBox"];
			shadowCopyCheckBox = (CheckBox)panel.ControlDictionary["shadowCopyCheckBox"];			
			createXmlOutputFileCheckBox = (CheckBox)panel.ControlDictionary["createXmlOutputFileCheckBox"];			
		}
コード例 #20
0
		/// <summary>
		/// Runs the test for the project after a successful build.
		/// </summary>
		void OnBuildComplete(BuildResults results, IProject project, string namespaceFilter, IClass fixture, IMember test)
		{
			if (results.ErrorCount == 0 && IsRunningTest) {
				UnitTestApplicationStartHelper helper = new UnitTestApplicationStartHelper();
				
				UnitTestingOptions options = new UnitTestingOptions();
				helper.NoThread = options.NoThread;
				helper.NoLogo = options.NoLogo;
				helper.NoDots = options.NoDots;
				helper.Labels = options.Labels;
				helper.ShadowCopy = !options.NoShadow;
				
				if (options.CreateXmlOutputFile) {
					helper.XmlOutputFile = Path.Combine(Path.GetDirectoryName(project.OutputAssemblyFullPath), project.AssemblyName + "-TestResult.xml");
				}
				
				helper.Initialize(project, namespaceFilter, fixture, test);
				helper.Results = Path.GetTempFileName();
				
				ResetTestResults(project);

				testResultsMonitor.FileName = helper.Results;
				testResultsMonitor.Start();
				
				try {
					RunTests(helper);
				} catch {
					StopMonitoring();
					throw;
				}
			} else {
				if (IsRunningTest) {
					Stop();
				}
				if (TaskService.SomethingWentWrong && ErrorListPad.ShowAfterBuild) {
					ShowErrorList();
				}
			}
		}
コード例 #21
0
		public NUnitConsoleApplication(SelectedTests selectedTests, UnitTestingOptions options)
		{
			Initialize(selectedTests);
			InitializeOptions(options);
		}
コード例 #22
0
		public UnitTestingOptionsPanel(UnitTestingOptions options)
		{
			this.options = options;
		}
コード例 #23
0
 public NUnitConsoleApplication(IEnumerable <ITest> selectedTests, UnitTestingOptions options)
 {
     Initialize(selectedTests);
     InitializeOptions(options);
 }
コード例 #24
0
		public MockNUnitTestFramework(IUnitTestProcessRunner processRunner,
			ITestResultsMonitor testResultsMonitor, 
			UnitTestingOptions options)
			: this(null, processRunner, testResultsMonitor, options, null)
		{
		}
コード例 #25
0
 public NUnitConsoleApplication(SelectedTests selectedTests, UnitTestingOptions options)
 {
     Initialize(selectedTests);
     InitializeOptions(options);
 }
コード例 #26
0
		public NUnitTestRunner(TestProcessRunnerBaseContext context, UnitTestingOptions options)
			: base(context)
		{
			this.options = options;
		}
コード例 #27
0
 public NUnitTestRunner(TestProcessRunnerBaseContext context,
                        UnitTestingOptions options)
     : base(context)
 {
     this.options = options;
 }
コード例 #28
0
		public NUnitConsoleApplication(IEnumerable<ITest> selectedTests, UnitTestingOptions options)
		{
			Initialize(selectedTests);
			InitializeOptions(options);
		}
コード例 #29
0
 public UnitTestingOptionsPanel(UnitTestingOptions options)
 {
     this.options = options;
 }
コード例 #30
0
		public DerivedUnitTestingOptionsPanel(UnitTestingOptions options) : base(options)
		{
		}
コード例 #31
0
		public void Init()
		{
			p = new Properties();
			defaultOptions = new UnitTestingOptions(p);
		}
コード例 #32
0
		public void CreateXmlOutputFileSetToTrueInProperties()
		{
			Properties newProperties = new Properties();
			newProperties.Set<bool>(UnitTestingOptions.CreateXmlOutputFileProperty, true);
			UnitTestingOptions options = new UnitTestingOptions(newProperties);
			
			Assert.IsTrue(options.CreateXmlOutputFile);
		}
コード例 #33
0
		public void LabelsSetToTrueInProperties()
		{
			Properties newProperties = new Properties();
			newProperties.Set<bool>(UnitTestingOptions.LabelsProperty, true);
			UnitTestingOptions options = new UnitTestingOptions(newProperties);
			
			Assert.IsTrue(options.Labels);
		}
コード例 #34
0
		public void XmlOutputFileNameSpecifiedOnCommandLine()
		{
			UnitTestingOptions options = new UnitTestingOptions(new Properties());
			options.CreateXmlOutputFile = true;
			NUnitTestClass testFixture = new NUnitTestClass(testProject, new FullTypeName("MyTests.TestFixture.MyTest"));
			NUnitConsoleApplication app = new NUnitConsoleApplication(new[] { testFixture }, options);
			app.NoLogo = false;
			app.ShadowCopy = true;
			
			string expectedCommandLine =
				"\"C:\\Projects\\MyTests\\MyTests.dll\" " +
				"/xml=\"C:\\Projects\\MyTests\\MyTests-TestResult.xml\" " +
				"/run=\"MyTests.TestFixture.MyTest\"";
			Assert.AreEqual(expectedCommandLine, app.GetArguments());
		}