Created
June 30, 2018 04:32
-
-
Save TyounanMOTI/442262050bd7854720b6009857635125 to your computer and use it in GitHub Desktop.
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
using NUnit.Framework; | |
using System.Threading.Tasks; | |
public class AsyncTest { | |
async Task<string> Subject() { | |
await Task.Delay(1000); | |
return "test"; | |
} | |
[Test] | |
public async void Async() { | |
var result = await Subject(); | |
Assert.AreEqual(result, "test"); | |
Assert.That(false); // 失敗してくれない | |
} | |
[Test] | |
public void Wait() { | |
var task = Subject(); | |
task.Wait(); // Unity Editorの応答がなくなる | |
Assert.That(false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment