コード例 #1
0
        public void Handle_WhenContextIsNull_ExceptionExpected()
        {
            var      viewModel = TestHelper.CreateWindowOneViewModel();
            var      state     = new WindowOneInitialState(viewModel);
            IContext context   = null;

            // ReSharper disable once ExpressionIsAlwaysNull
            Assert.Catch <ArgumentNullException>(() => state.Go(context));
        }
コード例 #2
0
        public void Handle_WhenContextIsCorrect_SetExpectedStateToContext()
        {
            var viewModel = TestHelper.CreateWindowOneViewModel();
            var state     = new WindowOneInitialState(viewModel);
            var context   = viewModel.Context;

            state.Go(context);

            Assert.AreEqual(typeof(WindowOneWithActiveButtonState), context.State.GetType());
        }
コード例 #3
0
        public void Handle_WhenContextIsCorrect_SetCanExecuteSecondButtonToTrue()
        {
            var viewModel = TestHelper.CreateWindowOneViewModel();
            var state     = new WindowOneInitialState(viewModel);
            var context   = viewModel.Context;

            state.Go(context);

            Assert.IsTrue(viewModel.CanExecuteSecondButtonCommand);
        }