Skip to content

Commit

Permalink
refactor: Fix warnings and suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
timabell committed Dec 22, 2023
1 parent cf1dbd8 commit fcc095e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/CLI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Options
[Option('s', "solution", Required = true, HelpText = "path to .sln file to modify")]
public string SlnPath { get; set; }

Check warning on line 18 in src/CLI.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SlnPath' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 18 in src/CLI.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SlnPath' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

[CommandLine.Value(0)]
[Value(0)]
public IEnumerable<string> Paths { get; set; }

Check warning on line 21 in src/CLI.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Paths' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 21 in src/CLI.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Paths' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}

Expand Down
18 changes: 9 additions & 9 deletions tests/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public class IntegrationTests
private readonly string _testFolder;

private static readonly string[] GuidsToReturn =
{
[
// deterministic GUID list for tests so we can assert against a fixed expected sln contents
"17591C35-3F90-4F4A-AA13-45CF8D824066",
"CF942CDD-19AC-4E52-9C6E-B1381E0406D9",
"F5636E74-888A-4FBD-A8E2-9718A05D90BD",
"D6CA39BB-4B2F-4AF7-94B9-D1269AE037D3",
"5B009B7F-333C-469A-AB3D-24E29C18C544",
};
];

public IntegrationTests(ITestOutputHelper output)
{
Expand Down Expand Up @@ -53,12 +53,12 @@ public void AddsToBlankSln()

SetupFilesystem(new[]
{
"rootfile.txt",
"root-file.txt",
"subfolder/nested_folder/nested_file.txt",
});

// Act
_cli.Run(new[] { "-s", TargetSlnFile, "rootfile.txt", "subfolder" });
_cli.Run(["-s", TargetSlnFile, "root-file.txt", "subfolder"]);

// Assert
const string expected = @"
Expand All @@ -68,7 +68,7 @@ public void AddsToBlankSln()
MinimumVisualStudioVersion = 10.0.40219.1
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""SolutionItems"", ""SolutionItems"", ""{17591C35-3F90-4F4A-AA13-45CF8D824066}""
ProjectSection(SolutionItems) = preProject
rootfile.txt = rootfile.txt
root-file.txt = root-file.txt
EndProjectSection
EndProject
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""subfolder"", ""subfolder"", ""{CF942CDD-19AC-4E52-9C6E-B1381E0406D9}""
Expand Down Expand Up @@ -109,7 +109,7 @@ public void IgnoresExistingItems()
MinimumVisualStudioVersion = 10.0.40219.1
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""SolutionItems"", ""SolutionItems"", ""{17591C35-3F90-4F4A-AA13-45CF8D824066}""
ProjectSection(SolutionItems) = preProject
rootfile.txt = rootfile.txt
root-file.txt = root-file.txt
EndProjectSection
EndProject
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""subfolder"", ""subfolder"", ""{CF942CDD-19AC-4E52-9C6E-B1381E0406D9}""
Expand Down Expand Up @@ -138,12 +138,12 @@ public void IgnoresExistingItems()

SetupFilesystem(new[]
{
"rootfile.txt",
"root-file.txt",
"subfolder/nested_folder/nested_file.txt",
});

// Act
_cli.Run(new[] { "-s", TargetSlnFile, "rootfile.txt", "subfolder" });
_cli.Run(["-s", TargetSlnFile, "root-file.txt", "subfolder"]);

// Assert
const string expected = @"
Expand All @@ -153,7 +153,7 @@ public void IgnoresExistingItems()
MinimumVisualStudioVersion = 10.0.40219.1
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""SolutionItems"", ""SolutionItems"", ""{17591C35-3F90-4F4A-AA13-45CF8D824066}""
ProjectSection(SolutionItems) = preProject
rootfile.txt = rootfile.txt
root-file.txt = root-file.txt
EndProjectSection
EndProject
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""subfolder"", ""subfolder"", ""{CF942CDD-19AC-4E52-9C6E-B1381E0406D9}""
Expand Down

0 comments on commit fcc095e

Please sign in to comment.