Ejemplo n.º 1
0
        public void Should_bind_to_enter_event()
        {
            var machine = new AnytimeStateMachineTest();

            machine.RaiseEvent(AnytimeStateMachineTest.BigBang);

            machine.UniverseIsExpanding.ShouldBeTrue();
        }
Ejemplo n.º 2
0
        public void Should_bind_the_event_handler_to_every_state()
        {
            var machine = new AnytimeStateMachineTest();

            machine.RaiseEvent(AnytimeStateMachineTest.BigBang);

            machine.BigBangOccurred.ShouldBeTrue();
            machine.CurrentState.ShouldEqual(AnytimeStateMachineTest.Completed);
        }
Ejemplo n.º 3
0
        public void Should_bind_to_event_and_not_change_state()
        {
            var machine = new AnytimeStateMachineTest();

            machine.RaiseEvent(AnytimeStateMachineTest.Supernova);

            machine.SupernovaOccurred.ShouldBeTrue();
            machine.CurrentState.ShouldEqual(AnytimeStateMachineTest.Initial);
            machine.UniverseIsExpanding.ShouldBeFalse();
        }
Ejemplo n.º 4
0
        public void Should_be_visible_in_the_visualizer()
        {
            var machine = new AnytimeStateMachineTest();

            StateMachineInspector.Trace(machine);
        }