Trigger a state that doesn't exist, CanFire API is allowed, FireAsync API doesn't throw an exception I think it's a little illogical,
after _machine. PermittedTriggers , obtaining target state available Triggers,then an exception is throwning, why not CanFire should be told that not allowed, then In FireAsync API throw an exception
// "null" is not exist state
_machine.Configure(State.A.ToString()) .Permit(Trigger.EB.ToString(), "null");
if (_machine.CanFire(Trigger.EB.ToString())) {
await bar._machine.FireAsync(Trigger.EB.ToString());
if (_machine.PermittedTriggers == null) continue;
foreach (var machinePermittedTrigger in ._machine.PermittedTriggers) {
Console.WriteLine("can trigger:" + machinePermittedTrigger);
}
}
Trigger a state that doesn't exist, CanFire API is allowed, FireAsync API doesn't throw an exception I think it's a little illogical, after _machine. PermittedTriggers , obtaining target state available Triggers,then an exception is throwning, why not CanFire should be told that not allowed, then In FireAsync API throw an exception