Exemple #1
0
        public void Execute()
        {
            var expectedCount = _actualCount;

            _sut.Execute(1);

            Assert.AreNotEqual(expectedCount, _actualCount);
            Assert.IsTrue(expectedCount < _actualCount);
        }
Exemple #2
0
        public void CannotExecute()
        {
            int expectedCount = _actualCount;
            var sut           = new CommandDisableAble <int>(
                o => false, _actionToExecute);

            bool actualResult = sut.CanExecute(_parameters);

            Assert.AreEqual(expected: false, actualResult);

            sut.Execute(_parameters);
            Assert.AreEqual(expectedCount, _actualCount);

            sut.Execute(_parameters as object);
            Assert.AreEqual(expectedCount, _actualCount);
        }
Exemple #3
0
 public void CanExecute_ThrowsInvalidCastException()
 {
     Assert.ThrowsException <InvalidCastException>(
         () => _sut.Execute(""));
 }