public void ExecuteWithCanExecute()
        {
            var executed = false;
            var cmd      = new DarkCommand(() => executed = true, () => true);

            cmd.Execute(null);
            Assert.True(executed);
        }
        public void ExecuteRunsIfReferenceTypeAndSetToNull()
        {
            var executions = 0;
            var command    = new DarkCommand <FakeChildContext>(context => executions += 1);

            command.Execute(null);
            Assert.True(executions == 1, "the command should have executed");
        }
        public void ExecuteRunsIfNullableAndSetToNull()
        {
            var executions = 0;
            var command    = new DarkCommand <int?>(context => executions += 1);

            command.Execute(null);
            Assert.True(executions == 1, "the command should have executed");
        }
        public void GenericExecuteWithCanExecute()
        {
            string result = null;
            var    cmd    = new DarkCommand <string>(s => result = s, s => true);

            cmd.Execute("Foo");
            Assert.Equal("Foo", result);
        }
        public void ExecuteParameterized()
        {
            object executed = null;
            var    cmd      = new DarkCommand(o => executed = o);

            var expected = new object();

            cmd.Execute(expected);

            Assert.Equal(expected, executed);
        }