Esempio n. 1
0
        public void ItRegistersStateControllers()
        {
            var store      = new StateStore();
            var controller = new CurrentHealthController();

            store.AddController("CurrentHealth", controller);

            var currentHealth = store.GetState <float>("CurrentHealth");

            Assert.AreEqual(currentHealth, controller.GetState());
        }
Esempio n. 2
0
        public void AllIsWell()
        {
            var store = new StateStore();

            store.AddController("CurrentHealth", new CurrentHealthController());

            store.Dispatch(new StoreAction {
                Type    = "UpdateCurrentHealth",
                Payload = 20f
            });

            Assert.AreEqual(store.GetState <float>("CurrentHealth"), 20f);
        }