非常简单的测试:
[TestClass]
public class MyTestClass
{
private TestContext _testContext;
protected TestContext TestContext
{
get { return _testContext; }
set { _testContext = value; }
}
[TestMethod]
[HostType("ASP.NET")]
[UrlToTest("http://localhost/MyPage.aspx")]
public void TestMyPage()
{
Assert.IsNotNull(TestContext);
}
}失败...现在我使用的是VS2008开发版。有没有可能解决这个问题?或者我需要一个Test (或Team Suite)版本?
谢谢。
附注:只有访问TestContext对象的RequestedPage属性,才能访问该对象
发布于 2010-06-18 05:02:12
我非常确定TestContext必须是一个公共属性,框架才能为您设置它。你试过把它公之于众吗?
https://stackoverflow.com/questions/3065549
复制相似问题