• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RunState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



RunState类属于命名空间,在下文中一共展示了RunState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Run

 public Run( Profiler p, ProjectInfo pi )
 {
     _p = p;
     _dtStart = DateTime.Now;
     _dtEnd = DateTime.MaxValue;
     _rs = RunState.Initializing;
     _tic = new ThreadInfoCollection();
     _pi = pi;
     _rmcMessages = new RunMessageCollection();
     _bSuccess = false;
 }
开发者ID:ilya11211,项目名称:nprof,代码行数:11,代码来源:Run.cs


示例17: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this)
            {
                PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8
            };
            //graphicsDevice = new GraphicsDevice();
            Content.RootDirectory = "Content";

            runState = RunState.MainMenu;

            graphics.IsFullScreen = false;
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;

            loadPercentage = 0;
        }
开发者ID:Thinny-Hendrix,项目名称:MoonCow,代码行数:17,代码来源:Game1.cs


示例18: Initialize

 private void Initialize(string name, object fixture)
 {
     this.name = name;
     this.fixture = fixture;
     this.fullName = this.fixture.GetType().FullName + "." + name;
     this.method = Reflect.GetMethod(this.fixture.GetType(), name);
     if (this.method == null)
         this.runState = RunState.NotRunnable;
     else 
     {
         IgnoreAttribute ignore = (IgnoreAttribute)Reflect.GetAttribute(this.method, typeof(IgnoreAttribute));
         if (ignore != null)
         {
             this.runState = RunState.Ignored;
             this.ignoreReason = ignore.Reason;
         }
     }
 }
开发者ID:RecursosOnline,项目名称:c-sharp,代码行数:18,代码来源:TestCase.cs


示例19: TestSuite

        public TestSuite(Type type)
        {
            TestObject = Reflect.Construct(type, null);

            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, TestObject));
                    }
                    else if (IsTestFixtureSetup(method))
                    {
                        TestFixtureSetUpMethod = method;

                    }else if (IsTestFixtureTearDownAttribute(method))
                    {
                        TestFixtureTearDownMethod = method;
                    }
                }
            }
        }
开发者ID:rhwilburn,项目名称:MVVM-for-Mono,代码行数:42,代码来源:TestSuite.cs


示例20: TestInfo

		/// <summary>
		/// Construct from an ITest
		/// </summary>
		/// <param name="test">Test from which a TestNode is to be constructed</param>
		public TestInfo( ITest test )
		{
			this.testName = (TestName)test.TestName.Clone();
			this.testType = test.TestType;

            this.runState = test.RunState;
			this.ignoreReason = test.IgnoreReason;
			this.description = test.Description;
			this.isSuite = test.IsSuite;

			if (test.Categories != null) 
				this.categories.AddRange(test.Categories);
			if (test.Properties != null)
			{
				this.properties = new ListDictionary();
				foreach( DictionaryEntry entry in test.Properties )
					this.properties.Add( entry.Key, entry.Value );
			}

			this.testCaseCount = test.TestCount;
		}
开发者ID:Phaiax,项目名称:dotnetautoupdate,代码行数:25,代码来源:TestInfo.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RunWorkerCompletedEventHandler类代码示例发布时间:2022-05-24
下一篇:
C# RunProperties类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap