Skip to content

Commit

Permalink
Update tests to match v6 SlnEditor behaviour
Browse files Browse the repository at this point in the history
No longer writes empty section.
Now correctly creates hierarchy.
  • Loading branch information
timabell committed Dec 27, 2023
1 parent ff5c525 commit d22ec5a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions tests/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ public void AddsToBlankSln()
root-file.txt = root-file.txt
EndProjectSection
EndProject
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""subfolder"", ""subfolder"", ""{CF942CDD-19AC-4E52-9C6E-B1381E0406D9}""
EndProject
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""nested_folder"", ""nested_folder"", ""{F5636E74-888A-4FBD-A8E2-9718A05D90BD}""
ProjectSection(SolutionItems) = preProject
subfolder\nested_folder\nested_file.txt = subfolder\nested_folder\nested_file.txt
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -81,10 +88,13 @@ public void AddsToBlankSln()
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CF942CDD-19AC-4E52-9C6E-B1381E0406D9} = {17591C35-3F90-4F4A-AA13-45CF8D824066}
{F5636E74-888A-4FBD-A8E2-9718A05D90BD} = {CF942CDD-19AC-4E52-9C6E-B1381E0406D9}
EndGlobalSection
EndGlobal
";

File.WriteAllText(Path.Combine(_testFolder, "expected.sln"), expected); // for kdiff debugging

ModifiedSln().Should().Be(expected);
}

Expand Down Expand Up @@ -158,8 +168,6 @@ public void IgnoresExistingItems()
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CF942CDD-19AC-4E52-9C6E-B1381E0406D9} = {17591C35-3F90-4F4A-AA13-45CF8D824066}
{F5636E74-888A-4FBD-A8E2-9718A05D90BD} = {CF942CDD-19AC-4E52-9C6E-B1381E0406D9}
Expand All @@ -170,6 +178,8 @@ public void IgnoresExistingItems()
EndGlobal
";

File.WriteAllText(Path.Combine(_testFolder, "expected.sln"), expected); // for kdiff debugging

ModifiedSln().Should().Be(expected);
}

Expand Down Expand Up @@ -244,8 +254,6 @@ public void RemovesMissingFiles()
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CF942CDD-19AC-4E52-9C6E-B1381E0406D9} = {17591C35-3F90-4F4A-AA13-45CF8D824066}
{F5636E74-888A-4FBD-A8E2-9718A05D90BD} = {CF942CDD-19AC-4E52-9C6E-B1381E0406D9}
Expand All @@ -256,6 +264,8 @@ public void RemovesMissingFiles()
EndGlobal
";

File.WriteAllText(Path.Combine(_testFolder, "expected.sln"), expected); // for kdiff debugging

ModifiedSln().Should().Be(expected);
}

Expand Down Expand Up @@ -313,15 +323,13 @@ public void CustomFolderName()
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CF942CDD-19AC-4E52-9C6E-B1381E0406D9} = {17591C35-3F90-4F4A-AA13-45CF8D824066}
{F5636E74-888A-4FBD-A8E2-9718A05D90BD} = {CF942CDD-19AC-4E52-9C6E-B1381E0406D9}
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
";
File.WriteAllText(Path.Combine(_testFolder, "expected.sln"), expected); // for kdiff debugging
Expand Down

0 comments on commit d22ec5a

Please sign in to comment.