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


C# RunState类代码示例

本文整理汇总了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()"));
                }
            }
        }
开发者ID:RecursosOnline,项目名称:c-sharp,代码行数:28,代码来源:TestSuite.cs

示例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;
            }
        }
开发者ID:skela,项目名称:NUnitLite.MonoDroid,代码行数:33,代码来源:TestCase.cs

示例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);
                    //}
                }
            }
        }
开发者ID:imgen,项目名称:Andr.Unit,代码行数:34,代码来源:TestSuite.cs

示例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));
		}
开发者ID:kobida,项目名称:nunitv2,代码行数:7,代码来源:NUnitTestCaseBuilderTests.cs

示例5: TryApplyRunState

 public void TryApplyRunState(RunState state, string reason)
 {
     if (_runStatePriorities[state] < _runStatePriorities[_test.RunState])
     {
         _test.RunState = state;
         _test.IgnoreReason = reason;
     }
 }
开发者ID:edwardt,项目名称:DreamNJasmine,代码行数:8,代码来源:NativeTest.cs

示例6: OnTestClassStarting

 private void OnTestClassStarting(object sender, TestClassStartingEventArgs e)
 {
     if (!IsRunning)
     {
         IsRunning = true;
         runState = new RunState();
     }
 }
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:8,代码来源:UnitTestMonitor.cs

示例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;
        }
开发者ID:minhhh,项目名称:nunit-unity3d,代码行数:14,代码来源:TestCaseAttribute.cs

示例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;
        }
开发者ID:dexterchan,项目名称:TestDNAPlugin,代码行数:9,代码来源:TestInputForm.cs

示例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;
 }
开发者ID:jmcadams,项目名称:vplus,代码行数:9,代码来源:VirtualHardware.cs

示例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());
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:9,代码来源:NUnitTestFilterTest.cs

示例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;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:13,代码来源:Test.cs

示例12: ChangeState

		private void ChangeState(RunState newState)
		{
			RunState = newState;			
			
			if (RunStateChanged != null)
			{
				RunStateChanged(this, EventArgs.Empty);
			}
		}
开发者ID:tica,项目名称:DataFlow,代码行数:9,代码来源:FilterGraph.Execution.cs

示例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();
        }
开发者ID:dexterchan,项目名称:TestDNAPlugin,代码行数:10,代码来源:TestInputForm.cs

示例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;
        }
开发者ID:scottwis,项目名称:eddie,代码行数:16,代码来源:Test.cs

示例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();
 }
开发者ID:ltvinh,项目名称:FRDB-SQLite,代码行数:10,代码来源:ThreadBLL.cs


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