mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
31 lines
No EOL
1.1 KiB
C#
31 lines
No EOL
1.1 KiB
C#
using LibHac.Common;
|
|
using LibHac.Fs;
|
|
using Xunit;
|
|
|
|
namespace LibHac.Tests.Fs.IFileSystemTestBase
|
|
{
|
|
public abstract partial class IFileSystemTests
|
|
{
|
|
[Fact]
|
|
public void DeleteDirectoryRecursively_DeletesDirectoryAndChildren()
|
|
{
|
|
IFileSystem fs = CreateFileSystem();
|
|
|
|
fs.CreateDirectory("/dir".ToU8Span());
|
|
fs.CreateDirectory("/dir/dir2".ToU8Span());
|
|
fs.CreateFile("/dir/file1".ToU8Span(), 0, CreateFileOptions.None);
|
|
|
|
Result rcDelete = fs.DeleteDirectoryRecursively("/dir".ToU8Span());
|
|
|
|
Result rcDir1Type = fs.GetEntryType(out _, "/dir".ToU8Span());
|
|
Result rcDir2Type = fs.GetEntryType(out _, "/dir/dir2".ToU8Span());
|
|
Result rcFileType = fs.GetEntryType(out _, "/dir/file1".ToU8Span());
|
|
|
|
Assert.True(rcDelete.IsSuccess());
|
|
|
|
Assert.Equal(ResultFs.PathNotFound.Value, rcDir1Type);
|
|
Assert.Equal(ResultFs.PathNotFound.Value, rcDir2Type);
|
|
Assert.Equal(ResultFs.PathNotFound.Value, rcFileType);
|
|
}
|
|
}
|
|
} |