LibHac/tests/LibHac.Tests/Fs/IFileSystemTestBase/IFileSystemTests.OpenFile.cs
Alex Barney feef0ff63f Fixup ConcatenationFileSystem
- Experiment with using Catch/Handle/Rethrow for logging Results
- Try adding a new Ret function for logging results
- Misc tweaks
2021-12-21 17:45:27 -07:00

33 lines
No EOL
820 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 OpenFile_PathIsDirectory_ReturnsPathNotFound()
{
IFileSystem fs = CreateFileSystem();
fs.CreateDirectory("/dir");
using var file = new UniqueRef<IFile>();
Result rc = fs.OpenFile(ref file.Ref(), "/dir", OpenMode.All);
Assert.Result(ResultFs.PathNotFound, rc);
}
[Fact]
public void OpenFile_PathDoesNotExist_ReturnsPathNotFound()
{
IFileSystem fs = CreateFileSystem();
using var file = new UniqueRef<IFile>();
Result rc = fs.OpenFile(ref file.Ref(), "/file", OpenMode.All);
Assert.Result(ResultFs.PathNotFound, rc);
}
}