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)); }
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()); }
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); }