fix unit test · microsoft/VSConfigFinder@17c9680 (original) (raw)

Original file line number Diff line number Diff line change
@@ -87,14 +87,16 @@ public void ReadComponents_Reads_AllNestedDirectories_And_OutputsAllComponents()
87 87 /*
88 88 * folder structure:
89 89 * pathA
90 + * - .vsconfig
90 91 * - pathB
92 + * - .vsconfig
91 93 */
92 94
93 95 var fileSystem = new Mock<IFileSystem>();
94 96
95 97 var options = new CommandLineOptions
96 98 {
97 -FolderPath = new[] { "C:\\input" },
99 +FolderPath = new[] { "C:\\pathA" },
98 100 ConfigOutputPath = "C:\\output",
99 101 };
100 102
@@ -112,7 +114,7 @@ public void ReadComponents_Reads_AllNestedDirectories_And_OutputsAllComponents()
112 114 var pathAReader = new MemoryStream(Encoding.UTF8.GetBytes(pathAConfig));
113 115
114 116 // pathB
115 -var pathB = "C:\\pathB";
117 +var pathB = "C:\\pathA\\pathB";
116 118 var pathBConfig = """
117 119 {
118 120 "Version": "1.0",
@@ -124,7 +126,7 @@ public void ReadComponents_Reads_AllNestedDirectories_And_OutputsAllComponents()
124 126 """;
125 127 var pathBReader = new MemoryStream(Encoding.UTF8.GetBytes(pathBConfig));
126 128
127 -fileSystem.Setup(x => x.GetFileSystemEntries(options.FolderPath, ".vsconfig", true)).Returns(new[] { pathA, pathB });
129 +fileSystem.Setup(x => x.GetFileSystemEntries("C:\\pathA", "*.vsconfig", true)).Returns(new[] { pathA, pathB });
128 130
129 131 fileSystem.Setup(x => x.OpenFile(pathA)).Returns(pathAReader);
130 132 fileSystem.Setup(x => x.OpenFile(pathB)).Returns(pathBReader);