public void ReduceShouldExecuteEachReducer() { var action = new EmptyAction(); var oldState = new FakeState(); var newState = _rootReducer.Reduce(oldState, action); Assert.AreSame(action, _actionReducer.Action); Assert.AreSame(oldState, _actionReducer.PreviousState); Assert.AreNotSame(newState, oldState); }
public void TestRootReducer() { // prepare var state = new RootState(); // act var resultState = RootReducer.Reduce(state, new SetSearchTextAction("xxx")); // assert Assert.AreEqual(resultState.Search.SearchText, "xxx"); }
public void Dispatch(TAction action) { ApplicationState = RootReducer.Reduce(ApplicationState, action); NotifySubscribers(); }