public void CreatesNoSolutionFoldersForSimpleProjectStructure() { var sln = new Sln("sample", slnGuid) { ProjectsRootDirectory = "Fake/Example" }; sln.AddProjects(new CsProj { Path = "Fake/Example/ProjectA/ProjectA.csproj" }); sln.AddProjects(new CsProj { Path = "Fake/Example/ProjectB/ProjectB.csproj" }); Assert.That(sln.Folders, Is.Null, "Folders"); }
private void MakeSolution(string name, params CsProj[] csProjs) { _solution = new Sln(name, "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") { ProjectsRootDirectory = @"C:\Code\src" }; _solution.AddProjects(csProjs); }
public void CreatesSolutionFoldersForNestedProjectStructure() { var sln = new Sln("sample", slnGuid) { ProjectsRootDirectory = "Fake/Example" }; sln.AddProjects(new CsProj { Path = "Fake/Example/ModuleA/ProjectA/ProjectA.csproj" }); sln.AddProjects(new CsProj { Path = "Fake/Example/ModuleA/ProjectB/ProjectB.csproj" }); var folder = sln.Folders.FirstOrDefault(); Assert.That(folder.FolderName, Is.EqualTo("ModuleA")); Assert.That(folder.ContentGuids.Count, Is.EqualTo(2)); }
public void CreatesSolutionFoldersForNestedProjectStructure() { var sln = new Sln("sample") { ProjectsRootDirectory = "Fake/Example" }; sln.AddProjects(new CsProj { Path = "Fake/Example/ModuleA/ProjectA/ProjectA.csproj" }); sln.AddProjects(new CsProj { Path = "Fake/Example/ModuleA/ProjectB/ProjectB.csproj" }); var folder = sln.Folders.FirstOrDefault(); StringAssert.Equals("ModuleA", folder.FolderName); Assert.AreEqual(2, folder.ContentGuids.Count); }
public void HandlesTrailingSlashOnRootDirectory() { var sln = new Sln("sample") { ProjectsRootDirectory = "Fake/Example/" }; var proj = new CsProj { Path = "Fake/Example/ModuleA/ProjectA/ProjectA.csproj", Guid = Guid.NewGuid().ToString("B") }; sln.AddProjects(proj); Assert.AreNotEqual(new Folder(), sln.Folders.FirstOrDefault(f => f.FolderName == "ModuleA"), "Folders"); }
public void CreatesNestedSolutionFolders() { var sln = new Sln("sample") { ProjectsRootDirectory = "Fake/Example" }; var proj = new CsProj { Path = "Fake/Example/Grouping1/ModuleA/ProjectA/ProjectA.csproj", Guid = Guid.NewGuid().ToString("B") }; sln.AddProjects(proj); var child = sln.Folders.First(f => f.FolderName == "ModuleA"); var parent = sln.Folders.First(f => f.FolderName == "Grouping1"); CollectionAssert.AreEqual(new[] { child.Guid }, parent.ContentGuids.ToArray()); CollectionAssert.AreEqual(new[] { proj.Guid }, child.ContentGuids.ToArray()); }
private void MakeSolution(string name, params Proj[] csProjs) { solution = new Sln(name, "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"); solution.AddProjects(csProjs); }
private void MakeSolution(string name, params CsProj[] csProjs) { solution = new Sln(name, "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"); solution.Version = VisualStudioVersion.VS2010; solution.AddProjects(csProjs); }