Пример #1
0
 public static State RootReducer(State state, IAction action)
 {
     return(new State
     {
         CounterState = CounterSlice.CounterReducer(state.CounterState, action),
         GameState = GameSlice.GameReducer(state.GameState, action)
     });
 }
Пример #2
0
        public void InFactoryTimesliceCounters()
        {
            InitGadgetControlFactory();
            ControlFactory factory = ControlFactory.GetControlFactory(TEST_FACTORY_KEY);

            factory.Counters.IsGlobalCounterEnabled = true;

            Assert.AreEqual(0, factory.Counters.GetGlobalCount(), "Count not initially zero");

            GadgetMaster master = GadgetMaster.CreateGadget(TEST_FACTORY_KEY, GadgetTestData.FullGadget, new OffsetItem(GadgetTestData.GadgetOffsetListString));

            ResolveDataControlValues(master.MyDataContext, GadgetTestData.Viewer, GadgetTestData.Viewer, null);
            string result = master.RenderToString("profile");

            Assert.Greater(master.Controls.Count, 0, "Empty control tree");

            CounterSlice slice = factory.Counters.GetCurrentCountTimeslice();

            Assert.Greater(slice.Count, 0, "Slice empty");
        }