本文整理汇总了C#中RunState类的典型用法代码示例。如果您正苦于以下问题:C# RunState类的具体用法?C# RunState怎么用?C# RunState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RunState类属于命名空间,在下文中一共展示了RunState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSuite
public TestSuite(Type type)
{
this.name = type.Name;
this.fullName = type.FullName;
object[] attrs = type.GetCustomAttributes( typeof(PropertyAttribute), true);
foreach (PropertyAttribute attr in attrs)
this.Properties[attr.Name] = attr.Value;
IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(type, typeof(IgnoreAttribute));
if (ignore != null)
{
this.runState = RunState.Ignored;
this.ignoreReason = ignore.Reason;
}
if ( !InvalidTestSuite(type) )
{
foreach (MethodInfo method in type.GetMethods())
{
if (IsTestMethod(method))
this.AddTest(HasValidSignature(method)
? Reflect.ConstructTestCase(method)
: new InvalidTestCase(method.Name,
"Test methods must have signature void MethodName()"));
}
}
}
示例2: Initialize
private void Initialize(MethodInfo method, object fixture)
{
this.name = method.Name;
this.method = method;
this.fullName = method.ReflectedType.FullName + "." + name;
this.fixture = fixture;
if ( fixture == null )
this.fixture = Reflect.Construct(method.ReflectedType, null);
if (!HasValidSignature(method))
{
this.runState = RunState.NotRunnable;
this.ignoreReason = "Test methods must have signature void MethodName()";
}
else
{
IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(this.method, typeof(IgnoreAttribute));
if (ignore != null)
{
this.runState = RunState.Ignored;
this.ignoreReason = ignore.Reason;
}
}
foreach (MethodInfo m in method.ReflectedType.GetMethods())
{
if (Reflect.HasAttribute(m, typeof(SetUpAttribute)))
this.setup = m;
if (Reflect.HasAttribute(m, typeof(TearDownAttribute)))
this.teardown = m;
}
}
示例3: TestSuite
public TestSuite(Type type)
{
this.name = type.Name;
this.fullName = type.FullName;
object[] attrs = type.GetCustomAttributes( typeof(PropertyAttribute), true);
foreach (PropertyAttribute attr in attrs)
foreach( DictionaryEntry entry in attr.Properties )
this.Properties[entry.Key] = entry.Value;
IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(type, typeof(IgnoreAttribute));
if (ignore != null)
{
this.runState = RunState.Ignored;
this.ignoreReason = ignore.Reason;
}
if ( !InvalidTestSuite(type) )
{
foreach (MethodInfo method in type.GetMethods())
{
if (TestCase.IsTestMethod(method))
this.AddTest(new TestCase(method));
//{
// ITest test = TestCase.HasValidSignature(method)
// ? (ITest)new TestCase(method)
// : (ITest)new InvalidTestCase(method.Name,
// "Test methods must have signature void MethodName()");
// this.AddTest(test);
//}
}
}
}
示例4: AsyncTests
public void AsyncTests(MethodInfo method, RunState state)
{
var built = _sut.BuildFrom(method);
Assert.That(built, Is.InstanceOf<NUnitAsyncTestMethod>());
Assert.That(built.RunState, Is.EqualTo(state));
}
示例5: TryApplyRunState
public void TryApplyRunState(RunState state, string reason)
{
if (_runStatePriorities[state] < _runStatePriorities[_test.RunState])
{
_test.RunState = state;
_test.IgnoreReason = reason;
}
}
示例6: OnTestClassStarting
private void OnTestClassStarting(object sender, TestClassStartingEventArgs e)
{
if (!IsRunning)
{
IsRunning = true;
runState = new RunState();
}
}
示例7: TestCaseAttribute
/// <summary>
/// Construct a TestCaseAttribute with a list of arguments.
/// This constructor is not CLS-Compliant
/// </summary>
/// <param name="arguments"></param>
public TestCaseAttribute(params object[] arguments)
{
this.runState = RunState.Runnable;
if (arguments == null)
this.arguments = new object[] { null };
else
this.arguments = arguments;
}
示例8: runCalculation
public void runCalculation(Object o)
{
DataResponse r = (DataResponse)o;
Thread.Sleep(1000 * 20);
r.data = MakeArrayetest(r.row, r.col);
sendRequest(r, null);
myState = RunState.IDLE;
}
示例9: VirtualHardware
public VirtualHardware(int boardLayoutWidth, int boardLayoutHeight, int ledSize, Color ledColor, int dotPitch)
{
this.m_display = null;
this.m_state = RunState.Stopped;
this.m_boardLayout = new Size(boardLayoutWidth, boardLayoutHeight);
this.m_ledSize = ledSize;
this.m_ledColor = ledColor;
this.m_dotPitch = dotPitch;
}
示例10: Match_returns_true_if_run_state_is_not_explicit
public void Match_returns_true_if_run_state_is_not_explicit(RunState runState)
{
test.Stub(t => t.TestName).Return(testName);
test.RunState = runState;
var result = testFilter.Match(test);
Assert.That(result, Is.True());
}
示例11: Test
/// <summary>
/// Constructs a test given its name
/// </summary>
/// <param name="name">The name of the test</param>
protected Test( string name )
{
this.testName = new TestName();
this.testName.FullName = name;
this.testName.Name = name;
this.testName.TestID = new TestID();
this.runState = RunState.Runnable;
}
示例12: ChangeState
private void ChangeState(RunState newState)
{
RunState = newState;
if (RunStateChanged != null)
{
RunStateChanged(this, EventArgs.Empty);
}
}
示例13: btnGo_Click
private void btnGo_Click(object sender, EventArgs e)
{
myState = RunState.RUN;
r = new DataResponse();
r.row = Int32.Parse( this.txtRow.Text);
r.col = Int32.Parse(this.txtCol.Text);
ThreadPool.QueueUserWorkItem(this.runCalculation, r);
//this.Close();
}
示例14: Test
/// <summary>
/// Constructs a test given the path through the
/// test hierarchy to its parent and a name.
/// </summary>
/// <param name="pathName">The parent tests full name</param>
/// <param name="name">The name of the test</param>
protected Test( string pathName, string name )
{
this.testName = new TestName();
this.testName.FullName = pathName == null || pathName == string.Empty
? name : pathName + "." + name;
this.testName.Name = name;
this.testName.TestID = new TestID();
this.runState = RunState.Runnable;
}
示例15: ThreadBLL
public ThreadBLL()
{
this._workerThread = null;
this._connected = false;
this._task = null;
this._runState = RunState.idle;
this._connString = String.Empty;///////////////////////important
this.Connection = new SQLiteConnection();
this.Adapt = new SQLiteDataAdapter();
}