public void Invoke() { bool wasInvoked = false; Action action = () => { wasInvoked = true; }; var command = new UnloadProjectCommand(action); var context = new UnloadProjectContext(); command.Invoke(context); context.Result.Wait(); Assert.IsTrue(wasInvoked); }