-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support calling async method to InitializeOnLaunchAutopilotAttribute
- Loading branch information
1 parent
1c05186
commit fa6c0dc
Showing
5 changed files
with
82 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Tests/Runtime/TestDoubles/SpyInitializeOnLaunchAutopilot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,43 @@ | ||
// Copyright (c) 2023 DeNA Co., Ltd. | ||
// This software is released under the MIT License. | ||
|
||
using System.Threading.Tasks; | ||
using Cysharp.Threading.Tasks; | ||
using DeNA.Anjin.Attributes; | ||
|
||
namespace DeNA.Anjin.TestDoubles | ||
{ | ||
public static class SpyInitializeOnLaunchAutopilot | ||
{ | ||
public static bool IsCallInitializeOnLaunchAutopilotMethod { get; private set; } | ||
public static bool IsCallInitializeOnLaunchAutopilotMethodAsync { get; private set; } | ||
public static bool IsCallInitializeOnLaunchAutopilotMethodUniTaskAsync { get; private set; } | ||
|
||
public static void Reset() | ||
{ | ||
IsCallInitializeOnLaunchAutopilotMethod = false; | ||
IsCallInitializeOnLaunchAutopilotMethodAsync = false; | ||
IsCallInitializeOnLaunchAutopilotMethodUniTaskAsync = false; | ||
} | ||
|
||
[InitializeOnLaunchAutopilot] | ||
public static void InitializeOnLaunchAutopilotMethod() | ||
{ | ||
IsCallInitializeOnLaunchAutopilotMethod = true; | ||
} | ||
|
||
[InitializeOnLaunchAutopilot] | ||
public static async Task InitializeOnLaunchAutopilotMethodAsync() | ||
{ | ||
await Task.Delay(0); | ||
IsCallInitializeOnLaunchAutopilotMethodAsync = true; | ||
} | ||
|
||
[InitializeOnLaunchAutopilot] | ||
public static async UniTask InitializeOnLaunchAutopilotMethodUniTaskAsync() | ||
{ | ||
await UniTask.Delay(0); | ||
IsCallInitializeOnLaunchAutopilotMethodUniTaskAsync = true; | ||
} | ||
} | ||
} |