exitcodetestfixture.cs
来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 41 行
CS
41 行
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision: 1092 $</version>
// </file>
using ICSharpCode.SharpDevelop.Util;
using NUnit.Framework;
using System;
using System.IO;
namespace ICSharpCode.SharpDevelop.Tests
{
/// <summary>
/// Tests that exit codes are read correctly by the
/// process runner.
/// </summary>
[TestFixture]
//[Ignore("Ignoring since need to run ConsoleApp.exe")]
public class ExitCodeTestFixture : ConsoleAppTestFixtureBase
{
[Test]
public void NonZeroExitCode()
{
ProcessRunner runner = new ProcessRunner();
runner.WorkingDirectory = Path.GetDirectoryName(GetConsoleAppFileName());
int expectedExitCode = 1;
Assert.IsFalse(runner.IsRunning, "IsRunning should be false.");
runner.Start(GetConsoleAppFileName(), String.Concat("-exitcode:", expectedExitCode.ToString()));
runner.WaitForExit();
Assert.AreEqual(expectedExitCode, runner.ExitCode, "Exit code is incorrect.");
Assert.IsFalse(runner.IsRunning, "IsRunning should be false.");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?