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


C# TestTask.Run方法代码示例

本文整理汇总了C#中TestTask.Run方法的典型用法代码示例。如果您正苦于以下问题:C# TestTask.Run方法的具体用法?C# TestTask.Run怎么用?C# TestTask.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestTask的用法示例。


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

示例1: RunMinute

 public void RunMinute()
 {
     var now = DateTime.UtcNow;
     var tt = new TestTask((byte)now.Hour, (sbyte)now.Minute);
     tt.Run();
     Assert.IsTrue(tt.Called);
 }
开发者ID:modulexcite,项目名称:King.Service,代码行数:7,代码来源:RunAtTaskTests.cs

示例2: RunWithFalseResultMarksStatusAsFailed

        public void RunWithFalseResultMarksStatusAsFailed()
        {
            var task = new TestTask
            {
                Result = () => false
            };
            var result = mocks.DynamicMock<IIntegrationResult>();

            mocks.ReplayAll();
            task.Run(result);
            mocks.VerifyAll();

            Assert.IsTrue(task.Executed);
            Assert.AreEqual(ItemBuildStatus.CompletedFailed, task.CurrentStatus.Status);
        }
开发者ID:RubenWillems,项目名称:CruiseControl.NET,代码行数:15,代码来源:TaskBaseTests.cs

示例3: Execute_should_call_wait_for_exit_before_ExitCode

 public void Execute_should_call_wait_for_exit_before_ExitCode()
 {
     //Since mono is broken and won't give us the ExitCode otherwise.
     var process = new ProcessStub();
     var waitForExitCalled = false;
     process.WaitForExitHandler = () => waitForExitCalled = true;
     process.GetExitCodeHandler = () =>
     {
         Assert.IsTrue(waitForExitCalled);
         return 0;
     };
     var platform = new ExecutionEnvironmentStub();
     var fileSystem = new InMemoryFileSystem();
     platform.RunHandler = (program, args, handler) => handler(process);
     var task = new TestTask(fileSystem, platform);
     task.Run();
 }
开发者ID:simoneb,项目名称:Pencil,代码行数:17,代码来源:ExecTaskBaseTests.cs

示例4: RunWrongMinute

 public void RunWrongMinute()
 {
     var now = DateTime.UtcNow;
     var minute = now.Minute > 1 ? now.Minute - 1 : 2;
     var tt = new TestTask((byte)now.Hour, (sbyte)minute);
     tt.Run();
     Assert.IsFalse(tt.Called);
 }
开发者ID:modulexcite,项目名称:King.Service,代码行数:8,代码来源:RunAtTaskTests.cs

示例5: RunWrongHour

 public void RunWrongHour()
 {
     var now = DateTime.UtcNow;
     var hour = now.Hour > 1 ? now.Hour - 1 : 2;
     var tt = new TestTask((byte)hour);
     tt.Run();
     Assert.IsFalse(tt.Called);
 }
开发者ID:modulexcite,项目名称:King.Service,代码行数:8,代码来源:RunAtTaskTests.cs

示例6: ApplyParametersStoresTheArguments

        public void ApplyParametersStoresTheArguments()
        {
            var parameters = new Dictionary<string, string>();
            var definitions = new List<ParameterBase>();
            var subTask = new MockTask();
            var task = new TestTask
            {
                Tasks = new ITask[] 
                {
                    subTask
                }
            };
            var result = mocks.DynamicMock<IIntegrationResult>();

            mocks.ReplayAll();
            task.ApplyParameters(parameters, definitions);
            task.Run(result);
            mocks.VerifyAll();

            Assert.AreSame(parameters, subTask.Parameters);
            Assert.AreSame(definitions, subTask.Definitions);
            Assert.IsTrue(subTask.Executed);
        }
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:23,代码来源:TaskContainerBaseTests.cs

示例7: RunWithExceptionMarksStatusAsFailed

        public void RunWithExceptionMarksStatusAsFailed()
        {
            var task = new TestTask
            {
                Result = () =>
                {
                    throw new CruiseControlException();
                }
            };
            var result = mocks.DynamicMock<IIntegrationResult>();

            mocks.ReplayAll();

            // This may look like a weird test, but we don't care that Run() has an exception
            try
            {
                task.Run(result);
            }
            catch (Exception) { }
            mocks.VerifyAll();

            Assert.IsTrue(task.Executed);
            Assert.AreEqual(ItemBuildStatus.CompletedFailed, task.CurrentStatus.Status);
        }
开发者ID:RubenWillems,项目名称:CruiseControl.NET,代码行数:24,代码来源:TaskBaseTests.cs


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