예제 #1
0
        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);
        }
예제 #2
0
        public void TestRootReducer()
        {
            // prepare
            var state = new RootState();

            // act
            var resultState = RootReducer.Reduce(state, new SetSearchTextAction("xxx"));

            // assert
            Assert.AreEqual(resultState.Search.SearchText, "xxx");
        }
예제 #3
0
 public void Dispatch(TAction action)
 {
     ApplicationState = RootReducer.Reduce(ApplicationState, action);
     NotifySubscribers();
 }