我有以下的测试夹具类和理由超越我NUnit的决定运行所有测试类的解决此一个,但不是这样的一个NUnit的测试中被忽略
using System.Workflow.Runtime;
using System.Workflow.Runtime.Hosting;
using MyProject;
using NUnit.Framework;
namespace MyProject.Test
{
[TestFixture]
public class MyProjectTests
{
private const string Description = "This is a test Description generated through UNIT Tests";
private ManualWorkflowSchedulerService scheduler;
private WorkflowRuntime workflowRuntime;
[SetUp]
public void Init()
{
// set up workflow scheduler and runtime
this.workflowRuntime = new WorkflowRuntime();
this.scheduler = new ManualWorkflowSchedulerService(true); // run synchronously
this.workflowRuntime.AddService(this.scheduler);
this.workflowRuntime.StartRuntime();
// create Test Case Sources
object[] insertScenarios =
{
new object[] { typeof(RaiseScenario), this.workflowRuntime, Description, true, true, string.Empty },
new object[] { typeof(RaiseScenario), this.workflowRuntime, Description, true, false, "New Reason" }
};
}
/// <summary>
/// The insert tests.
/// </summary>
/// <param name="runtime">
/// The runtime.
/// </param>
/// <param name="description">
/// The description.
/// </param>
/// <param name="outstandingWorkDocUploaded">
/// The Doc One Uploaded.
/// </param>
/// <param name="DocTwoUploaded">
/// The Doc Two Uploaded.
/// </param>
/// <param name="shortageReason">
/// The shortage Reason.
/// </param>
[Test, TestCaseSource("insertScenarios")]
public void TestInsert(
WorkflowRuntime runtime,
string description,
bool DocOneUploaded,
bool DocTwoUploaded,
string Reason)
{
var message = Business.InsertBoatHandoverOutsideCrew(runtime, description, DocOneUploaded, DocTwoUploaded, Reason);
Assert.AreNotEqual(0, message.Id);
}
}
}
测试项目的结构拆分进入它的组成部分,即解决方案的每个子项目在测试项目中都有自己的目录。这对于.Net 3.5中编写的所有其他项目来说都没有问题,但是这个项目的测试现在被忽略了。
没有严格的答案,但是你自己格式化这些评论? – ChrisBint
这是默认的GhostDoc输出,yeuck – mtijn
有没有可能'insertScenarios'不可用?你使它成为'Init()'的局部变量。 –