public void ImportWizardFolders() { var settings = new ImportSettings(); settings.SourcePath = TestData.GetPath("TestData\\HelloWorld2\\"); settings.Filters = "*"; settings.ProjectPath = TestData.GetPath("TestData\\TestDestination\\Subdirectory\\ProjectName.njsproj"); var path = settings.CreateRequestedProject(); Assert.AreEqual(settings.ProjectPath, path); var proj = XDocument.Load(path); Assert.AreEqual("..\\..\\HelloWorld2\\", proj.Descendant("ProjectHome").Value); AssertUtil.ContainsExactly(proj.Descendants(proj.GetName("Compile")).Select(x => x.Attribute("Include").Value), "server.js", "TestFolder\\SubItem.js", "TestFolder2\\SubItem.js", "TestFolder3\\SubItem.js"); AssertUtil.ContainsExactly(proj.Descendants(proj.GetName("Folder")).Select(x => x.Attribute("Include").Value), "TestFolder", "TestFolder2", "TestFolder3"); }
public void ImportWizardStartupFile() { var settings = new ImportSettings(); settings.SourcePath = TestData.GetPath("TestData\\HelloWorld\\"); settings.Filters = "*.js;*.njsproj"; settings.StartupFile = "server.js"; settings.ProjectPath = TestData.GetPath("TestData\\TestDestination\\Subdirectory\\ProjectName.njsproj"); var path = settings.CreateRequestedProject(); Assert.AreEqual(settings.ProjectPath, path); var proj = XDocument.Load(path); Assert.AreEqual("server.js", proj.Descendant("StartupFile").Value); }
public void ImportWizardExcludeBowerComponents() { var settings = new ImportSettings(); settings.SourcePath = TestData.GetPath("TestData\\HelloWorld6"); settings.Filters = "*.js"; settings.StartupFile = "server.js"; settings.ProjectPath = TestData.GetPath("TestData\\TestDestination\\Subdirectory\\ProjectName.njsproj"); var path = settings.CreateRequestedProject(); Assert.AreEqual(settings.ProjectPath, path); var proj = XDocument.Load(path); AssertUtil.ContainsExactly(proj.Descendants(proj.GetName("Folder")).Select(x => x.Attribute("Include").Value), "Baz"); }
public void ImportWizardTypeScript() { var settings = new ImportSettings(); settings.SourcePath = TestData.GetPath("TestData\\HelloWorldTypeScript\\"); settings.Filters = "*.ts;*.md;*.json"; settings.StartupFile = "server.ts"; settings.ProjectPath = TestData.GetPath("TestData\\TestDestination\\TsSubdirectory\\ProjectName.njsproj"); var path = settings.CreateRequestedProject(); Assert.AreEqual(settings.ProjectPath, path); var proj = XDocument.Load(path); AssertUtil.ContainsExactly(proj.Descendants(proj.GetName("TypeScriptCompile")).Select(x => x.Attribute("Include").Value), "server.ts"); Assert.AreEqual("server.ts", proj.Descendant("StartupFile").Value); }
public void ImportWizardIncludeNodeModules() { var settings = new ImportSettings(); settings.SourcePath = TestData.GetPath("TestData\\HelloWorld3\\"); settings.Filters = "*.js;*.njsproj"; settings.StartupFile = "server.js"; settings.ExcludeNodeModules = false; settings.ProjectPath = TestData.GetPath("TestData\\TestDestination\\Subdirectory\\ProjectName.njsproj"); var path = settings.CreateRequestedProject(); Assert.AreEqual(settings.ProjectPath, path); var proj = XDocument.Load(path); AssertUtil.ContainsExactly(proj.Descendants(proj.GetName("Compile")).Select(x => x.Attribute("Include").Value), "server.js", "node_modules\\mymod.js"); }
public void ImportWizardSimpleOther() { DispatcherTest(async() => { var settings = new ImportSettings(); settings.SourcePath = TestData.GetPath("TestData\\HelloWorldOther\\"); settings.Filters = "*.js;*.njsproj"; settings.ProjectPath = TestData.GetPath("TestData\\TestDestination\\Subdirectory\\ProjectName.njsproj"); await Dispatcher.Yield(); Assert.AreEqual("other.js", settings.StartupFile); var path = settings.CreateRequestedProject(); Assert.AreEqual(settings.ProjectPath, path); var proj = XDocument.Load(path); Assert.AreEqual("..\\..\\HelloWorldOther\\", proj.Descendant("ProjectHome").Value); AssertUtil.ContainsExactly(proj.Descendants(proj.GetName("Compile")).Select(x => x.Attribute("Include").Value), "other.js"); AssertUtil.ContainsExactly(proj.Descendants(proj.GetName("Content")).Select(x => x.Attribute("Include").Value), "HelloWorld.njsproj"); }); }