コード例 #1
0
        public void When_Dependant_Changes_On_CanExecute_It_Does_Not_Execute()
        {
            dynamic viewModel = new Automatic_Command_Properties();

            viewModel.Text = "Something";

            Assert.That(viewModel.CanExecuteSomethingWasExecuted, Is.False);
        }
コード例 #2
0
        public void CanExecute_Method_Is_Wrapped_By_Dynamic_Property(bool predicateResult)
        {
            dynamic viewModel = new Automatic_Command_Properties();

            viewModel.CanExecuteResult = predicateResult;

            Assert.That(viewModel.Something.CanExecute(null), Is.EqualTo(predicateResult));
        }
コード例 #3
0
        public void Execute_Method_Is_Wrapped_By_Dynamic_Property()
        {
            dynamic viewModel = new Automatic_Command_Properties();

            viewModel.Something.Execute(null);

            Assert.That(viewModel.SomethingWasExecuted);
        }
コード例 #4
0
        public void Execute_Method_Generates_ICommand_Property()
        {
            dynamic viewModel = new Automatic_Command_Properties();

            var command = viewModel.Something;

            Assert.That(command is ICommand);
        }
コード例 #5
0
        public void Changing_Text_Causes_CanExecuteChanged_To_Fire()
        {
            dynamic viewModel = new Automatic_Command_Properties();
            bool    CanExecuteChanged_Fired = false;

            (viewModel.Something as ICommand).CanExecuteChanged += (s, e) => CanExecuteChanged_Fired = true;

            viewModel.Text = "Foo";

            Assert.That(CanExecuteChanged_Fired);
        }
コード例 #6
0
        public void When_Dependant_Changes_On_CanExecute_It_Does_Not_Execute()
        {
            dynamic viewModel = new Automatic_Command_Properties();

            viewModel.Text = "Something";

            Assert.That(viewModel.CanExecuteSomethingWasExecuted, Is.False);
        }
コード例 #7
0
        public void Changing_Text_Causes_CanExecuteChanged_To_Fire()
        {
            dynamic viewModel = new Automatic_Command_Properties();
            bool CanExecuteChanged_Fired = false;
            (viewModel.Something as ICommand).CanExecuteChanged += (s, e) => CanExecuteChanged_Fired = true;

            viewModel.Text = "Foo";

            Assert.That(CanExecuteChanged_Fired);
         }
コード例 #8
0
        public void CanExecute_Method_Is_Wrapped_By_Dynamic_Property(bool predicateResult)
        {
            dynamic viewModel = new Automatic_Command_Properties();

            viewModel.CanExecuteResult = predicateResult;
            
            Assert.That(viewModel.Something.CanExecute(null), Is.EqualTo(predicateResult));
        }
コード例 #9
0
        public void Execute_Method_Is_Wrapped_By_Dynamic_Property()
        {
            dynamic viewModel = new Automatic_Command_Properties();

            viewModel.Something.Execute(null);

            Assert.That(viewModel.SomethingWasExecuted);
        }
コード例 #10
0
        public void Execute_Method_Generates_ICommand_Property()
        {
            dynamic viewModel = new Automatic_Command_Properties();

            var command = viewModel.Something;

            Assert.That(command is ICommand);
        }