-
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.
Merge pull request #68 from nowsprinting/feature/initialize_async
Support calling async method to InitializeOnLaunchAutopilotAttribute
- Loading branch information
Showing
10 changed files
with
147 additions
and
51 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
43 changes: 43 additions & 0 deletions
43
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 |
---|---|---|
@@ -0,0 +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; | ||
} | ||
} | ||
} |
File renamed without changes.