TestContext is null

Posted by Budda on Stack Overflow See other posts from Stack Overflow or by Budda
Published on 2010-06-17T20:52:41Z Indexed on 2010/06/17 21:03 UTC
Read the original article Hit count: 863

Filed under:
|
|
|
|

Pretty simple test:

[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);
    }
}

Fails... Now I am using VS2008 Development edition. Is there any possibility to fix this? Or I need to have a Test (or Team Suite) edition?

Thanks.

P.S. Access to TestContext object is required to have access to it's RequestedPage property

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET