Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jlee671 committed Feb 21, 2023
1 parent ca253dd commit 17c9680
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions VSConfigFinder.Test/UtilitiesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ public void ReadComponents_Reads_AllNestedDirectories_And_OutputsAllComponents()
/*
* folder structure:
* pathA
* - .vsconfig
* - pathB
* - .vsconfig
*/

var fileSystem = new Mock<IFileSystem>();

var options = new CommandLineOptions
{
FolderPath = new[] { "C:\\input" },
FolderPath = new[] { "C:\\pathA" },
ConfigOutputPath = "C:\\output",
};

Expand All @@ -112,7 +114,7 @@ public void ReadComponents_Reads_AllNestedDirectories_And_OutputsAllComponents()
var pathAReader = new MemoryStream(Encoding.UTF8.GetBytes(pathAConfig));

// pathB
var pathB = "C:\\pathB";
var pathB = "C:\\pathA\\pathB";
var pathBConfig = """
{
"Version": "1.0",
Expand All @@ -124,7 +126,7 @@ public void ReadComponents_Reads_AllNestedDirectories_And_OutputsAllComponents()
""";
var pathBReader = new MemoryStream(Encoding.UTF8.GetBytes(pathBConfig));

fileSystem.Setup(x => x.GetFileSystemEntries(options.FolderPath, ".vsconfig", true)).Returns(new[] { pathA, pathB });
fileSystem.Setup(x => x.GetFileSystemEntries("C:\\pathA", "*.vsconfig", true)).Returns(new[] { pathA, pathB });

fileSystem.Setup(x => x.OpenFile(pathA)).Returns(pathAReader);
fileSystem.Setup(x => x.OpenFile(pathB)).Returns(pathBReader);
Expand Down

0 comments on commit 17c9680

Please sign in to comment.