public void NotifiesExtensions_WhenGuardIsNotMet()
        {
            var extension = A.Fake <IExtension <States, Events> >();

            this.ExtensionHost.Extension = extension;

            IGuardHolder guard = Builder <States, Events> .CreateGuardHolder().ReturningFalse().Build();

            this.Testee.Guard = guard;

            this.Testee.Fire(this.TransitionContext);

            A.CallTo(() => extension.SkippedTransition(
                         this.StateMachineInformation,
                         A <ITransition <States, Events> > .That.Matches(t => t.Source == this.Source && t.Target == this.Target),
                         this.TransitionContext)).MustHaveHappened();
        }
示例#2
0
 public GuardBuilder()
 {
     this.guardHolder = A.Fake <IGuardHolder>();
 }
示例#3
0
 public TransitionInfo(TEvent eventId, IState <TState, TEvent> source, IState <TState, TEvent> target, IGuardHolder guard, IEnumerable <IActionHolder> actions)
 {
     this.EventId = eventId;
     this.Source  = source;
     this.Target  = target;
     this.Guard   = guard;
     this.Actions = actions;
 }