public async Task ExistingDependenciesFromSolution() { VSHost.EnsureSolution(@"LessDependencies\LessDependencies.sln"); await graph.RescanComplete; var sharedDeps = await graph.GetRecursiveDependentsAsync( Path.Combine(VSHost.FixtureDirectory, "LessDependencies", "_shared.less") ); sharedDeps .Select(Path.GetFileName) .Should() .BeEquivalentTo(new[] { "_admin.less", "Manager.less", "Home.less" }); var adminDeps = await graph.GetRecursiveDependentsAsync( Path.Combine(VSHost.FixtureDirectory, "LessDependencies", "Areas", "_admin.less") ); adminDeps .Select(Path.GetFileName) .Should() .BeEquivalentTo(new[] { "Manager.less" }); var homeDeps = await graph.GetRecursiveDependentsAsync( Path.Combine(VSHost.FixtureDirectory, "LessDependencies", "Home.less") ); homeDeps.Should().BeEmpty(); }
public void CreateGraph() { // Make sure VS has loaded before using MEF (prevents native access violations!) VSHost.EnsureSolution(@"LessDependencies\LessDependencies.sln"); // Don't create the instance using MEF, to ensure that I get a fresh graph for each test. graph = new LessDependencyGraph(WebEditor.ExportProvider.GetExport <IFileExtensionRegistryService>().Value); graph.IsEnabled = true; // Add the instance to the MEF catalog so that its IFileSaveListener is picked up graphPart = AttributedModelServices.CreatePart(graph); var cc = (CompositionContainer)WebEditor.CompositionService; cc.Compose(new CompositionBatch(new[] { graphPart }, null)); }
public async Task SolutionSettingsMigrationTest() { SettingsStore.InTestMode = false; // Enable settings load File.Delete(Path.Combine(VSHost.FixtureDirectory, "LegacySettings", SettingsStore.FileName)); VSHost.EnsureSolution(@"LegacySettings\LegacySettings.sln"); await Task.Delay(750); // Wait for things to load File.Exists(Path.Combine(VSHost.FixtureDirectory, "LegacySettings", SettingsStore.FileName)) .Should().BeTrue("opening solution with legacy settings file should create new settings file"); // Check some non-default values from the legacy XML WESettings.Instance.Less.CompileOnSave.Should().BeFalse(); WESettings.Instance.TypeScript.LintOnSave.Should().BeFalse(); // Check default values for new settings WESettings.Instance.Html.GzipMinifiedFiles.Should().BeFalse(); WESettings.Instance.Less.EnableChainCompilation.Should().BeTrue(); }
public void Init() { _item = VSHost.EnsureSolution(@"CodeGen\CodeGen.sln").FindProjectItem("Simple.cs"); _theObject = IntellisenseParser.ProcessFile(_item).First(); }
public void Init() { item = VSHost.EnsureSolution(@"CodeGen\CodeGen.sln").FindProjectItem("CollectionModel.cs"); theObject = IntellisenseParser.ProcessFile(item).First(); }
public static void Initialize(TestContext c) { SettingsStore.EnterTestMode(); VSHost.EnsureSolution(@"ProjectEnumeration\ProjectEnumeration.sln"); }