我今天早上一直在和watiN/Nunit一起玩,以捕捉失败的UI测试截图.但是,在访问Nunits TestContext.CurrentContext时,我遇到了NRE的问题......
关于我做错了什么的任何想法?
[TestFixture]
class SomePageTest
{
[Test]
[STAThread]
public void Page_IsAvailable()
{
var browser = new SomePage();
Assert.IsTrue(browser.ContainsText("Something"));
if (TestContext.CurrentContext.Result.Status == TestStatus.Failed)
{
browser.CaptureWebPageToFile(@"X:\location\" + TestContext.CurrentContext.Test.FullName);
}
}
}
public class SomePage: IE
{
public static string SomePageUrl = "http://somepage.com/someurl";
public SomePage() : base(SomePageUrl)
{
}
}
Run Code Online (Sandbox Code Playgroud)
嗯...在没有成功潜入这个例外后我遇到了这个帖子:http://www.barebonescoder.com/2010/10/nunit-and-the-new-testcontext-class/
从nunit的测试运行器运行我的测试是成功的......现在要弄清楚如何使用resharpers测试运行器来完成这项工作?
| 归档时间: |
|
| 查看次数: |
3714 次 |
| 最近记录: |