コード例 #1
0
        public void PersistenceOff()
        {
            // Create and Serialize
            PersistenceContext context = new PersistenceContext(this.actuator);

            context.EnterInitialState();
            Assert.AreEqual(context.StateCurrent.Name, "Off");

            string fileName = context.Name + "Off.dat";

            Serialize(context, fileName);

            // Create new , DeSerialize and check state
            PersistenceContext contextSerialized = new PersistenceContext(actuator);

            DeSerialize(contextSerialized, fileName);
            contextSerialized.EnterInitialState();
            Assert.AreEqual(contextSerialized.StateCurrent.Name, "Off");
        }