MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / CreateSampleDirectory

Method CreateSampleDirectory

test/UtilityTests.cs:165–186  ·  view source on GitHub ↗
(string directory)

Source from the content-addressed store, hash-verified

163 }
164
165 static void CreateSampleDirectory(string directory)
166 {
167 Random prng = new Random();
168 while (true) {
169 Directory.CreateDirectory(directory);
170
171 for (var j = 0; j < 100; j++) {
172 var file = Path.Combine(directory, newId());
173 if (file.Length > 260) continue;
174 File.WriteAllText(file, Guid.NewGuid().ToString());
175 }
176
177 if (prng.NextDouble() > 0.5) {
178 var childDirectory = Path.Combine(directory, newId());
179 if (childDirectory.Length > 248) return;
180 directory = childDirectory;
181 continue;
182 }
183
184 break;
185 }
186 }
187
188 static string newId()
189 {

Callers

nothing calls this directly

Calls 1

ToStringMethod · 0.45

Tested by

no test coverage detected