当前位置: 首页>>代码示例>>C#>>正文


C# Framework.TestDetails类代码示例

本文整理汇总了C#中NUnit.Framework.TestDetails的典型用法代码示例。如果您正苦于以下问题:C# TestDetails类的具体用法?C# TestDetails怎么用?C# TestDetails使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TestDetails类属于NUnit.Framework命名空间,在下文中一共展示了TestDetails类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AfterTest

 public void AfterTest(TestDetails details)
 {
     if (_lastAfterTestFullName == details.FullName) return;
       _lastAfterTestFullName = details.FullName;
       int startTickCount;
       if (!_testsProcessed.TryGetValue(details.FullName, out startTickCount))
     return;
       if (details.IsSuite)
       {
     int count;
     if (details.Fixture != null)
       _testsCount.TryGetValue(details.Fixture.GetType().Name, out count);
     else count = _totalTestCount;
     Console.WriteLine("[==========] {0} test from {1} ({2} ms total)",
                   count,
                   details.Fixture != null ? details.Fixture.GetType().Name : details.FullName,
                   Environment.TickCount - startTickCount);
     Console.WriteLine("");
       }
       else
       {
     string stateStr;
     switch (TestContext.CurrentContext.Result.State)
     {
       case TestState.Inconclusive:
     stateStr = "  INCONCL ";
     break;
       case TestState.NotRunnable:
     stateStr = "  CANTRUN ";
     break;
       case TestState.Skipped:
     stateStr = "  SKIPPED ";
     break;
       case TestState.Ignored:
     stateStr = "  IGNORED ";
     break;
       case TestState.Success:
     stateStr = "       OK ";
     break;
       case TestState.Failure:
     stateStr = "     FAIL ";
     break;
       case TestState.Error:
     stateStr = "    ERROR ";
     break;
       case TestState.Cancelled:
     stateStr = "   CANCEL ";
     break;
       default:
     throw new ArgumentOutOfRangeException();
     }
     {
       Console.WriteLine("[{0}] {1}.{2} ({3} ms total)",
                     stateStr,
                     details.Fixture != null ? details.Fixture.GetType().Name : "<no class>",
                     details.Method != null ? details.Method.Name : "{no method}",
                     Environment.TickCount - startTickCount);
     }
       }
 }
开发者ID:Convey-Compliance,项目名称:nunit-gteststyle-console-output,代码行数:60,代码来源:NUnitGStyleConsoleOutput.cs

示例2: BeforeTest

		/// <summary>
		/// Set the message box adapter
		/// </summary>
		public override void BeforeTest(TestDetails testDetails)
		{
			base.BeforeTest(testDetails);
			m_PreviousAdapter = s_CurrentAdapter;
			s_CurrentAdapter = (IMessageBox)Activator.CreateInstance(m_AdapterType);
			MessageBoxUtils.Manager.SetMessageBoxAdapter(s_CurrentAdapter);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:10,代码来源:SetMessageBoxAdapterAttribute.cs

示例3: BeforeTest

		public void BeforeTest(TestDetails details)
		{
			Console.WriteLine("----- Beginning Duality Editor environment setup -----");

			// Set environment directory to Duality binary directory
			this.oldEnvDir = Environment.CurrentDirectory;
			string codeBaseURI = typeof(DualityEditorApp).Assembly.CodeBase;
			string codeBasePath = codeBaseURI.StartsWith("file:") ? codeBaseURI.Remove(0, "file:".Length) : codeBaseURI;
			codeBasePath = codeBasePath.TrimStart('/');
			Environment.CurrentDirectory = Path.GetDirectoryName(codeBasePath);

			// Add some Console logs manually for NUnit
			if (!Log.Core.Outputs.OfType<TextWriterLogOutput>().Any(o => o.Target == Console.Out))
			{
				if (this.consoleLogOutput == null) this.consoleLogOutput = new TextWriterLogOutput(Console.Out);
				Log.AddGlobalOutput(this.consoleLogOutput);
			}

			// Create a dummy window for the editor
			if (this.dummyWindow == null)
				this.dummyWindow = new MainForm();

			// Initialize the Duality Editor
			DualityEditorApp.Init(this.dummyWindow, false);

			Console.WriteLine("----- Duality Editor environment setup complete -----");
		}
开发者ID:KehxD,项目名称:duality,代码行数:27,代码来源:InitDualityEditorAttribute.cs

示例4: AfterTest

        public void AfterTest(TestDetails details)
        {
            Console.WriteLine("----- Beginning Duality environment teardown -----");

            // Remove NUnit Console logs
            Log.RemoveGlobalOutput(this.consoleLogOutput);
            this.consoleLogOutput = null;

            if (this.dummyWindow != null)
            {
                ContentProvider.ClearContent();
                ContentProvider.DisposeDefaultContent();
                this.dummyWindow.Dispose();
                this.dummyWindow = null;
            }
            DualityApp.Terminate();
            Environment.CurrentDirectory = this.oldEnvDir;

            // Save local testing memory
            if (TestContext.CurrentContext.Result.Status == TestStatus.Passed && !System.Diagnostics.Debugger.IsAttached)
            {
                Serializer.WriteObject(TestHelper.LocalTestMemory, TestHelper.LocalTestMemoryFilePath, SerializeMethod.Xml);
            }

            Console.WriteLine("----- Duality environment teardown complete -----");
        }
开发者ID:ninja2003,项目名称:duality,代码行数:26,代码来源:InitDualityAttribute.cs

示例5: BeforeTest

 public void BeforeTest(TestDetails testDetails)
 {
     if (!IsNet45OrNewer())
     {
         Assert.Ignore("Requires .NET 4.5");
     }
 }
开发者ID:bjewell52,项目名称:Calamari,代码行数:7,代码来源:RequiresDotNet45Attribute.cs

示例6: BeforeTest

		public void BeforeTest(TestDetails details)
		{
			Console.WriteLine("----- Beginning Duality environment setup -----");

			// Set environment directory to Duality binary directory
			this.oldEnvDir = Environment.CurrentDirectory;
			string codeBaseURI = typeof(DualityApp).Assembly.CodeBase;
			string codeBasePath = codeBaseURI.StartsWith("file:") ? codeBaseURI.Remove(0, "file:".Length) : codeBaseURI;
			codeBasePath = codeBasePath.TrimStart('/');
			Environment.CurrentDirectory = Path.GetDirectoryName(codeBasePath);

			// Add some Console logs manually for NUnit
			if (!Log.Game.Outputs.OfType<ConsoleLogOutput>().Any())
			{
				Log.Game.AddOutput(new ConsoleLogOutput(ConsoleColor.DarkGray));
				Log.Core.AddOutput(new ConsoleLogOutput(ConsoleColor.DarkBlue));
				Log.Editor.AddOutput(new ConsoleLogOutput(ConsoleColor.DarkMagenta));
			}

			// Initialize Duality
			DualityApp.Init(DualityApp.ExecutionEnvironment.Launcher, DualityApp.ExecutionContext.Game);

			// Manually register pseudo-plugin for the Unit Testing Assembly
			DualityApp.AddPlugin(typeof(DualityTestsPlugin).Assembly, codeBasePath);

			Console.WriteLine("----- Duality environment setup complete -----");
		}
开发者ID:KETMGaming,项目名称:duality,代码行数:27,代码来源:InitDualityAttribute.cs

示例7: AfterTest

		/// <summary>
		/// Unset keyboard controller
		/// </summary>
		public override void AfterTest(TestDetails testDetails)
		{
			// Shut down (and implicitly dispose) the keyboard controller we created.
			KeyboardController.Shutdown();

			base.AfterTest(testDetails);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:10,代码来源:InitializeNoOpKeyboardControllerAttribute.cs

示例8: BeforeTest

 public void BeforeTest(TestDetails testDetails)
 {
     if (!IsUnix)
     {
         Assert.Ignore("Test is Ignored on Windows");
     }
 }
开发者ID:brus07,项目名称:protex,代码行数:7,代码来源:IgnoreOnWindowsAttribute.cs

示例9: BeforeTest

 public void BeforeTest(TestDetails testDetails)
 {
     var provider = Properties.Settings.Default.LinearAlgebraProvider.ToLowerInvariant();
     if (provider.Contains("mkl"))
     {
         Control.LinearAlgebraProvider = new Providers.LinearAlgebra.Mkl.MklLinearAlgebraProvider();
     }
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:8,代码来源:UseLinearAlgebraProvider.cs

示例10: BeforeTest

		/// <summary>
		/// Initialize keyboard controller
		/// </summary>
		public override void BeforeTest(TestDetails testDetails)
		{
			if (Keyboard.Controller != null)
				Keyboard.Controller.Dispose();

			KeyboardController.Initialize();
			base.BeforeTest(testDetails);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:InitializeRealKeyboardControllerAttribute.cs

示例11: AfterTest

		/// <summary>
		/// Shutdown keyboard controller
		/// </summary>
		public override void AfterTest(TestDetails testDetails)
		{
			base.AfterTest(testDetails);
			KeyboardController.Shutdown();

			if (InitDummyAfterTests)
				Keyboard.Controller = new NoOpKeyboardController();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:InitializeRealKeyboardControllerAttribute.cs

示例12: BeforeTest

		public void BeforeTest(TestDetails test)
		{
			_fixture = test.Fixture;
			_fixtureType = _fixture.GetType();

			buildContainer();
			injectMembers();
		}
开发者ID:Teleopti,项目名称:Stardust,代码行数:8,代码来源:BaseTestsAttribute.cs

示例13: AfterTest

		public void AfterTest(TestDetails testDetails)
		{
			if (context != null)
			{
				context.Dispose();
				context = null;
			}
		}
开发者ID:Exe0,项目名称:Eto,代码行数:8,代码来源:InvokeAttribute.cs

示例14: AfterTest

		public void AfterTest(TestDetails testDetails)
		{
			_refCount--;
			if (_refCount == 0)
			{
				_offlineSldr.Dispose();
				_offlineSldr = null;
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:9,代码来源:OfflineSldrAttribute.cs

示例15: BeforeTest

 public void BeforeTest(TestDetails testDetails)
 {
     if (String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(feedUri)) ||
         String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(feedUsernameVariable)) ||
         String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(feedPasswordVariable)))
     {
         Assert.Ignore("The authenticated feed tests were skipped because the " + feedUri + ", " + feedUsernameVariable + " and " +feedPasswordVariable + " environment variables are not set.");
     }
 }
开发者ID:bjewell52,项目名称:Calamari,代码行数:9,代码来源:AuthenticatedTestAttribute.cs


注:本文中的NUnit.Framework.TestDetails类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。