public void RelayCommandWithValidExecute_ExecuteWithNullParameter_Executes()
        {
            var executed = false;
            var command  = TestCommand.CreateWithExecute(_ => executed = true);

            command.Execute(null);

            Assert.True(executed);
        }
        public void RelayCommandWithValidExecute_ExecuteWithParameter_Executes()
        {
            var parameter = 5;
            var command   = TestCommand.CreateWithExecute(p =>
            {
                int passedParamter = (int)p;
                parameter          = ++passedParamter;
            });

            command.Execute(parameter);

            Assert.Equal(6, parameter);
        }
        public void RelayCommandWithNullExecuteAndDefaultCanExecute_CanExecuteWithParameter_CanExecuteReturnsTrue()
        {
            var command = TestCommand.CreateWithExecute(null);

            Assert.True(command.CanExecute(new object()));
        }
        public void RelayCommandWithNullExecute_ExecuteWithNullParamter_ThrowsNullReferenceException()
        {
            var command = TestCommand.CreateWithExecute(null);

            Assert.Throws <NullReferenceException>(() => command.Execute(null));
        }