mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
35 lines
No EOL
1.1 KiB
C#
35 lines
No EOL
1.1 KiB
C#
using LibHac.Common;
|
|
using LibHac.Fs;
|
|
using LibHac.Fs.Fsa;
|
|
using LibHac.Fs.Shim;
|
|
using LibHac.Tests.Fs.FileSystemClientTests;
|
|
using Xunit;
|
|
|
|
namespace LibHac.Tests.Fs.FsaTests;
|
|
|
|
public class MountUtilityTests
|
|
{
|
|
[Theory]
|
|
[InlineData("0123456789ABCDE", "0123456789ABCDE:/")]
|
|
[InlineData("01234", "01234:/")]
|
|
public void GetMountName_ValidName_ReturnsSuccess(string mountName, string path)
|
|
{
|
|
FileSystemClient fs = FileSystemServerFactory.CreateClient(true);
|
|
|
|
Assert.Success(fs.MountSdCard(mountName.ToU8Span()));
|
|
Assert.Success(fs.GetEntryType(out _, path.ToU8Span()));
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("01234", "01234")]
|
|
[InlineData("0123456789ABCDE", "0123456789ABCDE")]
|
|
[InlineData("01234", "0123456789ABCDEF")]
|
|
[InlineData("01234", "0123456789ABCDEF:/")]
|
|
public void GetMountName_InvalidName_ReturnsInvalidMountName(string mountName, string path)
|
|
{
|
|
FileSystemClient fs = FileSystemServerFactory.CreateClient(true);
|
|
|
|
Assert.Success(fs.MountSdCard(mountName.ToU8Span()));
|
|
Assert.Result(ResultFs.InvalidMountName, fs.GetEntryType(out _, path.ToU8Span()));
|
|
}
|
|
} |