LibHac/tests/LibHac.Tests/Fs/IFileSystemTestBase/IFileSystemTests.OpenDirectory.cs
2022-11-09 21:33:27 -07:00

33 lines
No EOL
910 B
C#

using LibHac.Common;
using LibHac.Fs;
using LibHac.Fs.Fsa;
using Xunit;
namespace LibHac.Tests.Fs.IFileSystemTestBase;
public abstract partial class IFileSystemTests
{
[Fact]
public void OpenDirectory_PathIsFile_ReturnsPathNotFound()
{
IFileSystem fs = CreateFileSystem();
fs.CreateFile("/file", 0, CreateFileOptions.None);
using var directory = new UniqueRef<IDirectory>();
Result res = fs.OpenDirectory(ref directory.Ref(), "/file", OpenDirectoryMode.All);
Assert.Result(ResultFs.PathNotFound, res);
}
[Fact]
public void OpenDirectory_PathDoesNotExist_ReturnsPathNotFound()
{
IFileSystem fs = CreateFileSystem();
using var directory = new UniqueRef<IDirectory>();
Result res = fs.OpenDirectory(ref directory.Ref(), "/dir", OpenDirectoryMode.All);
Assert.Result(ResultFs.PathNotFound, res);
}
}