public void TestInitialize() { rdt = null; }
private static CodeGenerationService CreateCodeGenerator(string itemPath, out MockVsRDT rdt) { string fullItemPath = Path.Combine(Directory.GetCurrentDirectory(), itemPath); string fullProjectPath = Path.Combine(Directory.GetCurrentDirectory(), "Project.project"); MockServiceProvider serviceProvider = new MockServiceProvider(); MockVSHierarchy vsHierarchy = new MockVSHierarchy(fullProjectPath); MockVsSolution vsSolution = new MockVsSolution(vsHierarchy); rdt = new MockVsRDT(fullItemPath, vsHierarchy, 0); MockVsTextManager textManager = new MockVsTextManager(); MockVsUIShellOpenDocument shellOpenDocument = new MockVsUIShellOpenDocument(); serviceProvider.AddService(typeof(SVsSolution), vsSolution); serviceProvider.AddService(typeof(IVsRunningDocumentTable), rdt); serviceProvider.AddService(typeof(VsTextManagerClass), textManager); serviceProvider.AddService(typeof(SVsUIShellOpenDocument), shellOpenDocument); return new TestableCodeGenerationService(serviceProvider); }