public async void MyButtonActionAsyncDoesNotCrash() { //arrange var buttonActionTask = new TestableAsyncEvents().MyButtonActionAsync(); //act await buttonActionTask; //assert Assert.That(buttonActionTask.Status, Is.EqualTo(TaskStatus.RanToCompletion)); }
public async void MyButtonActionAsyncDoesNotCrashWithXUnit() { //arrange var buttonActionTask = new TestableAsyncEvents().MyButtonActionAsync(); //act await buttonActionTask; //assert Assert.Equal(buttonActionTask.Status, TaskStatus.RanToCompletion); }