Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TestContext is null

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

like image 831
Budda Avatar asked Jun 17 '10 20:06

Budda


1 Answers

I'm pretty sure that TestContext has to be a public property in order for the framework to set it for you. Have you tried making it public?

like image 153
womp Avatar answered Oct 17 '22 10:10

womp