示例#1
0
        public void EnhanceDispatchTest()
        {
            var store = new MyEnhancer <State>(new Store <State>(new RootReducer(), new State(1)));

            store.Dispatch(new SetIdAction(1));
            store.Dispatch(new SetIdAction(2));
            Assert.AreEqual(2, store.ActionHistory.Count);
            Assert.AreEqual(1, (store.ActionHistory[0] as SetIdAction).Id);
            Assert.AreEqual(2, (store.ActionHistory[1] as SetIdAction).Id);
        }
示例#2
0
        public void EnhanceStateTest()
        {
            var store = new MyEnhancer <State>(new Store <State>(new RootReducer(), new State(1)));

            store.Dispatch(new SetIdAction(1));
            store.Dispatch(new SetIdAction(2));
            var state = store.State;

            state = store.State;
            Assert.AreEqual(2, store.StateGet);
        }