From 42e0cb4220711a06893abf008d9027a0d0f71745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Tue, 24 Oct 2023 08:01:46 +0200 Subject: [PATCH] Test EnumerateDirectories with trailing slash --- .../Directory/EnumerateDirectoriesTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs index 179f5b011..2f9a22d4a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs @@ -9,6 +9,21 @@ public abstract partial class EnumerateDirectoriesTests : FileSystemTestBase where TFileSystem : IFileSystem { + [SkippableTheory] + [InlineData("Folder", @"Folder\SubFolder")] + [InlineData(@"Folder\", @"Folder\SubFolder")] + [InlineData(@"Folder\..\.\Folder", @"Folder\..\.\Folder\SubFolder")] + public void MockDirectory_EnumerateDirectories_ShouldReturnPathsPrefixedWithQueryPath( + string queryPath, string expectedPath) + { + var fileSystem = new MockFileSystem(); + fileSystem.Directory.CreateDirectory("Folder/SubFolder"); + + var actualResult = fileSystem.Directory.EnumerateDirectories(queryPath); + + actualResult.Should().BeEquivalentTo(new[] { expectedPath }); + } + [SkippableFact] public void EnumerateDirectories_AbsolutePath_ShouldNotIncludeTrailingSlash() {