Ejemplo n.º 1
0
        public async Task CanExecute_returns_false_during_execution_and_true_after_completion()
        {
            var tcs     = new TaskCompletionSource <bool>();
            var command = new AsyncDelegateCommand <int>(x => tcs.Task);

            command.Execute(42);
            command.CanExecute(42).Should().BeFalse();
            tcs.SetResult(true);
            await command.WaitForCompletionAsync();

            command.CanExecute(42).Should().BeTrue();
        }