[TestClass]
public static class AssemblyTests
{
private static IDisposable _composerWrapper;
[Import]
private static IReportTestEnvironmentSetup _reportTestEnvironmentSetup;
[AssemblyInitialize]
public static void Initialize(TestContext context)
{
AssemblyTests._composerWrapper = Composer.Load();
TeamFoundationTestConfig.UpdateTfsReportServerInCommonConfig();
_reportTestEnvironmentSetup.ServiceWarmUp(TeamFoundationTestConfig.ReportingServiceBaseUrl);
_reportTestEnvironmentSetup.ServiceWarmUp(TeamFoundationTestConfig.SsrsWarmUpUrl.InvariantFormat(TeamFoundationTestConfig.TFSReportServer));
}
[AssemblyCleanup]
public static void Cleanup()
{
AssemblyTests._composerWrapper.Dispose();
}
}
如何在程序集初始化中导入IReportTestEnvirommentSetup
。这个类目前给我一个警告,表明该属性从未被分配。我在所有其他测试类中执行此操作并且它工作正常,因为AssemblyTests._composerWrapper = Composer.Load();
为当前应用程序设置了合成范围。
有人可以帮我纠正错误吗?