* Applies checks for root folders to static file tree service.
* Add integration tests.
* Fix ancestor test.
* Amends from code review.
* Integration test compatibility suppressions.
* Reverted breaking change in test base class.
(cherry picked from commit 84c15ff4d7)
This commit is contained in:
@@ -36,21 +36,23 @@ public abstract class FileSystemTreeServiceTestsBase : UmbracoIntegrationTest
|
||||
GetStylesheetsFileSystem(),
|
||||
GetScriptsFileSystem(),
|
||||
null);
|
||||
|
||||
CreateFiles();
|
||||
}
|
||||
|
||||
protected virtual void CreateFiles()
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
using var stream = CreateStream(Path.Join("tests"));
|
||||
using var stream = CreateStream();
|
||||
TestFileSystem.AddFile($"file{i}{FileExtension}", stream);
|
||||
}
|
||||
}
|
||||
|
||||
protected static Stream CreateStream(string contents = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(contents))
|
||||
{
|
||||
contents = "/* test */";
|
||||
}
|
||||
|
||||
var bytes = Encoding.UTF8.GetBytes(contents);
|
||||
const string DefaultFileContent = "/* test */";
|
||||
var bytes = Encoding.UTF8.GetBytes(contents ?? DefaultFileContent);
|
||||
return new MemoryStream(bytes);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user