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


C# TestEventArgs类代码示例

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


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

示例1: Event_Should_Be_Routed_To_Device_Target

        public void Event_Should_Be_Routed_To_Device_Target()
        {
            InputElement element = new InputElement();
            TestEventArgs e = new TestEventArgs(element);
            e.RoutedEvent = InputElement.RawEvent;
            InputManager.Current.ProcessInput(e);

            Assert.IsTrue(element.RawEventRaised);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:9,代码来源:WpfInputManagerTests.cs

示例2: TestAsyncEvents

 public void TestAsyncEvents() {
   var evtSource = new AsyncEventSource();
   evtSource.TestEvent += AsyncEventsTest_AsyncHandler;
   evtSource.TestEvent += AsyncEventsTest_SyncHandler;
   var args = new TestEventArgs() { Value = 2 }; // incr value; our counter should be incremented twice by 2 - in two event handlers
   _counter = 0; 
   AsyncHelper.RunSync(() => evtSource.RaiseEvent(args));
   // now _counter should be 4
   Assert.AreEqual(4, _counter, "Expected _counter set to 4");
 }//test method
开发者ID:yuanfei05,项目名称:vita,代码行数:10,代码来源:AsyncEventTests.cs

示例3: OnCompleteTestCase

 private void OnCompleteTestCase(object src, TestEventArgs args)
 {
     if (args.TestStatus == TestEventArgs.Status.Fail)
     {
         string msg = string.Format("Failed in Test Dll {0} on Test Case {1} with the error {2}", args.DLL, args.CurrentRun, args.TestCase.ErrorSolution);
         Assert.IsTrue(false, msg);
     }
     else
         Assert.IsTrue(true);            
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:10,代码来源:TestActionTester.cs

示例4: Event_Should_Not_Be_Routed_If_Cancelled

        public void Event_Should_Not_Be_Routed_If_Cancelled()
        {
            PreProcessInputEventHandler preProcess = (sender, ev) =>
            {
                ev.Cancel();
            };

            InputElement element = new InputElement();
            TestEventArgs e = new TestEventArgs(element);
            e.RoutedEvent = InputElement.RawEvent;

            InputManager.Current.PreProcessInput += preProcess;
            InputManager.Current.ProcessInput(e);
            InputManager.Current.PreProcessInput -= preProcess;

            Assert.IsFalse(element.RawEventRaised);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:17,代码来源:WpfInputManagerTests.cs

示例5: _test_OnTestFinished

 void _test_OnTestFinished(object sender, TestEventArgs args)
 {
   if (InvokeRequired)
     Invoke(new TestCompletedEvent(_test_OnTestFinished), sender, args);
   else
   {
     _grid.Rows[_grid.Rows.Count - 1].SetValues(args.TestName, args.Result, args.Duration, (args.Exception == null) ? args.Message : args.Exception.Message);
     if (args.Result == TestResultEnum.Failed)
     {
       _grid.Rows[_grid.Rows.Count - 1].Cells[1].Style.BackColor = Color.Red;
     }
     else if (args.Result == TestResultEnum.Inconclusive)
     {
       _grid.Rows[_grid.Rows.Count - 1].Cells[1].Style.BackColor = Color.LightBlue;
     }
     //_grid.Rows[_grid.Rows.Count - 1].Height = _grid.Rows[_grid.Rows.Count - 1].GetPreferredHeight(_grid.Rows.Count - 1, DataGridViewAutoSizeRowMode.AllCells, true);
   }
 }
开发者ID:AugustoAngeletti,项目名称:blockspaces,代码行数:18,代码来源:TestCasesDialog.cs

示例6: PreNotifyInput_Should_Be_Called

        public void PreNotifyInput_Should_Be_Called()
        {
            bool notified = false;

            NotifyInputEventHandler preNotify = (sender, ev) =>
            {
                notified = true;
            };

            InputElement element = new InputElement();
            TestEventArgs e = new TestEventArgs(element);
            e.RoutedEvent = InputElement.RawEvent;

            InputManager.Current.PreNotifyInput += preNotify;
            InputManager.Current.ProcessInput(e);
            InputManager.Current.PreNotifyInput -= preNotify;

            Assert.IsTrue(notified);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:19,代码来源:WpfInputManagerTests.cs

示例7: event_passes_correct_arguments

        public void event_passes_correct_arguments()
        {
            var expectedString = "test";
            var actualString = string.Empty;

            var testEventArgs = new TestEventArgs();
            testEventArgs.TestString = expectedString;

            var rootState = new StateMachineBuilder()
                .State<TestState>("foo")
                    .Event<TestEventArgs>("newEvent", (state, eventArgs) => actualString = eventArgs.TestString)
                .End()
                .Build();
            rootState.ChangeState("foo");

            rootState.TriggerEvent("newEvent", testEventArgs);

            Assert.Equal(expectedString, actualString);
        }
开发者ID:Real-Serious-Games,项目名称:Fluent-State-Machine,代码行数:19,代码来源:StateBuilderTests.cs

示例8: OnRunStarting

		private void OnRunStarting( object sender, TestEventArgs e )
		{
			suiteName.Text = e.Name;
			EnableRunCommand( false );
			EnableStopCommand( true );
			runCount.Text = "";
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:7,代码来源:NUnitForm.cs

示例9: OnTestChanged

		/// <summary>
		/// The current test suite has changed in some way,
		/// so update the info in the UI and clear the
		/// test results, since they are no longer valid.
		/// </summary>
		private void OnTestChanged( object sender, TestEventArgs e )
		{
            SetTitleBar(TestProject.Name);

			if ( longOpDisplay != null )
			{
				longOpDisplay.Dispose();
				longOpDisplay = null;
			}

            if (userSettings.GetSetting("Options.TestLoader.ClearResultsOnReload", false))
                runCount.Text = null;

			EnableRunCommand( true );
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:20,代码来源:NUnitForm.cs

示例10: OnTestLoaded

		/// <summary>
		/// A test suite has been loaded, so update 
		/// recent assemblies and display the tests in the UI
		/// </summary>
		private void OnTestLoaded( object sender, TestEventArgs e )
		{
			if ( longOpDisplay != null )
			{
				longOpDisplay.Dispose();
				longOpDisplay = null;
			}
			EnableRunCommand( true );
			
			if ( TestLoader.TestCount == 0 )
			{
				foreach( TestAssemblyInfo info in TestLoader.AssemblyInfo )
					if ( info.TestFrameworks.Count > 0 ) return;

                MessageDisplay.Error("This assembly was not built with any known testing framework.");
			}
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:21,代码来源:NUnitForm.cs

示例11: OnTestUnloadStarting

		private void OnTestUnloadStarting( object sender, TestEventArgs e )
		{
			EnableRunCommand( false );
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:4,代码来源:NUnitForm.cs

示例12: OnTestProjectUnloaded

		private void OnTestProjectUnloaded( object sender, TestEventArgs e )
		{
			SetTitleBar( null );
			projectMenu.Visible = false;
			runCount.Text = "";
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:6,代码来源:NUnitForm.cs

示例13: OnTestProjectLoaded

		private void OnTestProjectLoaded( object sender, TestEventArgs e )
		{
            string projectPath = e.Name;

			SetTitleBar( projectPath );
			projectMenu.Visible = true;
			runCount.Text = "";

            // If this is an NUnit project, set up watcher
            if (NUnitProject.IsNUnitProjectFile(projectPath) && File.Exists(projectPath))
                presenter.WatchProject(projectPath);
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:12,代码来源:NUnitForm.cs

示例14: FireEventWithMultipleHandlersDoesNotContinueAfterFirstHandlerTest

        public void FireEventWithMultipleHandlersDoesNotContinueAfterFirstHandlerTest()
        {
            string lastEventHandler = String.Empty;
            // Arrange
            eventUnderTest.EventSinks += ( sender, args ) =>
                                         {
                                             lastEventHandler = "EventHandlerOne";
                                             args.Continue = false;
                                         };
            eventUnderTest.EventSinks += ( sender, args ) =>
                                         {
                                             lastEventHandler = "EventHandlerTwo";
                                             args.Continue = true;
                                         };
            eventUnderTest.EventSinks += ( sender, args ) =>
                                         {
                                             lastEventHandler = "EventHandlerThree";
                                             args.Continue = true;
                                         };

            var argsUnderTest = new TestEventArgs()
            {
                Continue = true
            };
            // Act
            eventUnderTest.Fire( this, argsUnderTest, ( args ) => args.Continue == true );

            // Assert
            Assert.IsTrue( argsUnderTest.Continue == false && lastEventHandler == "EventHandlerOne", "{0} returned {1}", lastEventHandler, argsUnderTest.Continue );
        }
开发者ID:WolfgangSt,项目名称:axiom,代码行数:30,代码来源:ChainedEventTests.cs

示例15: FireEventWithMultipleHandlersTest

        public void FireEventWithMultipleHandlersTest()
        {
            // Arrange
            eventUnderTest.EventSinks += ( sender, args ) =>
                                         {
                                             args.Continue = true;
                                         };
            eventUnderTest.EventSinks += ( sender, args ) =>
                                         {
                                             args.Continue = true;
                                         };
            eventUnderTest.EventSinks += ( sender, args ) =>
                                         {
                                             args.Continue = true;
                                         };

            var argsUnderTest = new TestEventArgs()
                                {
                                    Continue = true
                                };
            // Act
            eventUnderTest.Fire( this, argsUnderTest, ( args ) => args.Continue == true );

            // Assert
            Assert.IsTrue( argsUnderTest.Continue );
        }
开发者ID:WolfgangSt,项目名称:axiom,代码行数:26,代码来源:ChainedEventTests.cs


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