示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="State&lt;TState, TEvent&gt;"/> class.
        /// </summary>
        /// <param name="id">The unique id of this state.</param>
        /// <param name="stateMachineInformation">The state machine information.</param>
        /// <param name="extensionHost">The extension host.</param>
        public State(TState id, IStateMachineInformation <TState, TEvent> stateMachineInformation, IExtensionHost <TState, TEvent> extensionHost)
        {
            this.Id    = id;
            this.level = 1;
            this.stateMachineInformation = stateMachineInformation;
            this.extensionHost           = extensionHost;

            this.subStates   = new List <IState <TState, TEvent> >();
            this.transitions = new TransitionDictionary <TState, TEvent>(this);

            this.EntryActions = new List <IActionHolder>();
            this.ExitActions  = new List <IActionHolder>();
        }
        public TransitionDictionaryTest()
        {
            this.stateMock = new Mock <IState <States, Events> >();

            this.testee = new TransitionDictionary <States, Events>(this.stateMock.Object);
        }