Example #1
0
        public void Constructor2_WhenArgumentsAreValid_ShouldSetFields()
        {
            var result = new Mvvm.Command(canExecute1_valid, toExecute2_valid);

            Assert.Throws <ApplicationException>(() => result.CanExecute(null));
            Assert.Throws <ApplicationException>(() => result.Execute(null));
        }
Example #2
0
        public void Execute_ShouldUseArgumentInInvokedMethod()
        {
            object result    = null;
            int    testValue = 2;

            var command = new Mvvm.Command(() => true, param => result = param);

            command.Execute(testValue);

            Assert.Equal(testValue, result);
        }