public class portal
{
public portal()
{
}
[DataSource ("Microsoft.VisualStudio.TestTools.DataSource.TestCase", "http://alm:8080/tfs/....", "15729", DataAccessMethod.Sequential), TestMethod]
public static void portalmtm()
{
BrowserWindow b = BrowserWindow.Launch(new System.Uri(TestContext.DataRow["portals"].ToString()));
}
public static TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
private static TestContext testContextInstance;
}
}
当我在 codeduitest (testmethod) System.NullReferenceException 中使用它时会出错:对象引用未设置为对象的实例。问题是什么?我该怎么办?谢谢...
[TestMethod]
public void Test1()
{
portalmtm();
this.UIMap....
this.UIMap....
}
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
private TestContext testContextInstance;