You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From my understanding (backed up by the test below), the Entry actions are not invoked for InternalTransitions, however, the DOT graph export includes this against the internal transition name for some reason.
I've thrown together a quick test demonstrating this:
[Test]
public void GenerateGraph_InternalTransitions()
{
int onEntry = 0;
int onInternal = 0;
const string on = "On";
const string off = "Off";
const char a = 'a';
const char space = ' ';
// Instantiate a new state machine in the 'off' state
var onOffSwitch = new StateMachine<string, char>(off);
// Configure state machine with the Configure method, supplying the state to be configured as a parameter
onOffSwitch.Configure(off)
.OnEntry(() => onEntry++)
.InternalTransition(a, () => onInternal++)
.Permit(space, on);
onOffSwitch.Configure(on).Permit(space, off);
var graph = UmlDotGraph.Format(onOffSwitch.GetInfo());
Console.WriteLine(graph);
Assert.That(onEntry, Is.EqualTo(0));
Assert.That(onInternal, Is.EqualTo(0));
onOffSwitch.Fire(a);
Assert.That(onEntry, Is.EqualTo(0));
Assert.That(onInternal, Is.EqualTo(1));
}
From my understanding (backed up by the test below), the Entry actions are not invoked for
InternalTransitions
, however, the DOT graph export includes this against the internal transition name for some reason.I've thrown together a quick test demonstrating this:
This outputs a graph like this:
The text was updated successfully, but these errors were encountered: