public void FindAsync_Should_Return_Null_After_Scope_Completion() { var scope = new NameScope(); var element = new object(); bool finished = false; async void Find(string name) { Assert.Null(await scope.FindAsync(name)); finished = true; } Find("foo"); Assert.False(finished); scope.Register("bar", element); Assert.False(finished); scope.Complete(); Assert.True(finished); }