LibHac/tests/LibHac.Tests/Fs/IFileSystemTestBase/IFileSystemTests.OpenFile.cs

23 lines
515 B
C#
Raw Normal View History

using LibHac.Common;
using LibHac.Fs;
using LibHac.Fs.Fsa;
using Xunit;
2021-11-14 20:08:57 +01:00
namespace LibHac.Tests.Fs.IFileSystemTestBase;
public abstract partial class IFileSystemTests
{
2021-11-14 20:08:57 +01:00
[Fact]
public void OpenFile_PathIsDirectory_ReturnsPathNotFound()
{
2021-11-14 20:08:57 +01:00
IFileSystem fs = CreateFileSystem();
2021-11-14 20:08:57 +01:00
fs.CreateDirectory("/dir");
2021-11-14 20:08:57 +01:00
using var file = new UniqueRef<IFile>();
Result rc = fs.OpenFile(ref file.Ref(), "/dir", OpenMode.All);
2021-11-14 20:08:57 +01:00
Assert.Result(ResultFs.PathNotFound, rc);
}
2021-11-14 20:08:57 +01:00
}