Skip to content

Commit

Permalink
Update Test_IMaaController.cs
Browse files Browse the repository at this point in the history
Update Test_IMaaController.cs
  • Loading branch information
moomiji committed Jan 3, 2024
1 parent 2b6b6ba commit 1700138
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/MaaFramework.Binding.UnitTests/Test_Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void InitializeAssembly(TestContext testContext)
InitializeInfo(testContext);

new MaaUtility().SetOption(GlobalOption.LogDir, DebugPath);
new MaaUtilityGrpc(GrpcChannel).SetOption(GlobalOption.LogDir, DebugPath);
new MaaUtility().SetOption(GlobalOption.StdoutLevel, LoggingLevel.Off);
Task.Run(() =>
{
MaaRpc.Wait();
Expand Down
7 changes: 6 additions & 1 deletion src/MaaFramework.Binding.UnitTests/Test_IMaaToolkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public void Interface_Find(MaaTypes type, IMaaToolkit maaToolkit, string arg)
Assert.IsNotNull(maaToolkit);

var devices = maaToolkit.Find(arg);
Assert.AreNotEqual(0, devices.Length);
if (Common.InGithubActions && devices.Length == 0)
return;
else
Assert.AreNotEqual(0, devices.Length);

CollectionAssert.AllItemsAreUnique(devices);
foreach (var device in devices)
{
Expand All @@ -72,6 +76,7 @@ public void Interface_Find(MaaTypes type, IMaaToolkit maaToolkit, string arg)
MaaTypes.Grpc => devices[0].ToAdbControllerGrpc(
Common.GrpcChannel,
Path.GetFullPath("./MaaAgentBinary"),
type: AdbControllerTypes.InputPresetAdb | AdbControllerTypes.ScreencapEncode,
link: LinkOption.None),
_ => throw new NotImplementedException(),
};
Expand Down
4 changes: 2 additions & 2 deletions src/MaaFramework.Binding.UnitTests/Test_IMaaUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public void Interface_Version(MaaTypes type, IMaaUtility maaUtility)
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.LogDir, nameof(Common.DebugPath))]
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.SaveDraw, false)]
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.Recording, false)]
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.StdoutLevel, LoggingLevel.Error)]
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.StdoutLevel, 2)]
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.StdoutLevel, LoggingLevel.Off)]
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.StdoutLevel, 0)]
[MaaData(MaaTypes.All, nameof(Data), GlobalOption.ShowHitDraw, false)]
public void Interface_SetOption(MaaTypes type, IMaaUtility maaUtility, GlobalOption opt, object arg)
{
Expand Down

0 comments on commit 1700138

Please sign in to comment.