Skip to content

Instantly share code, notes, and snippets.

@TyounanMOTI
Created June 30, 2018 04:32
Show Gist options
  • Save TyounanMOTI/442262050bd7854720b6009857635125 to your computer and use it in GitHub Desktop.
Save TyounanMOTI/442262050bd7854720b6009857635125 to your computer and use it in GitHub Desktop.
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