runningtestscondition.cs

来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 46 行

CS
46
字号
// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
//     <version>$Revision: 1069 $</version>
// </file>

using ICSharpCode.Core;
using System;

namespace ICSharpCode.UnitTesting
{
	/// <summary>
	/// Determines whether #develop is currently running unit tests.
	/// </summary>
	public class RunningTestsCondition : IConditionEvaluator
	{
		public bool IsValid(object caller, Condition condition)
		{
			// initializing PadContent might call IsValid
			if (caller is PadContent)
				return ((PadContent)caller).IsRunningTests;
			return PadContent.Instance.IsRunningTests;
		}
	}
	
	/// <summary>
	/// Determines whether starting unit tests by calling a command derived from
	/// AbstractRunTestCommand is possible.
	/// </summary>
	public class UnitCommonTestCommandsEnabledCondition : IConditionEvaluator
	{
		public bool IsValid(object caller, Condition condition)
		{
			if (PadContent.Instance.IsRunningTests)
				return false;
			TestTreeView view = caller as TestTreeView;
			if (view != null) {
				return view.SelectedProject != null;
			} else {
				return true;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?