private void AssertOneWayUpdatesPetriNetToFsm(Pn.Place p1, Fsm.State p1State) { if (p1 == null) { return; } p1.Id = "foo2"; Assert.AreEqual("foo2", p1State.Name); Assert.IsFalse(p1State.IsEndState); var t = new Pn.Transition(); t.From.Add(p1); pn.Transitions.Add(t); Assert.IsTrue(p1State.IsEndState); }
private void FillPetriNet() { var p1 = new Pn.Place() { Id = "s1" }; var p2 = new Pn.Place() { Id = "s2" }; var p3 = new Pn.Place() { Id = "s4" }; var t1 = new Pn.Transition() { Input = "a" }; var t2 = new Pn.Transition() { Input = "c" }; t1.From.Add(p1); t1.To.Add(p2); t2.From.Add(p1); t2.To.Add(p3); t2.To.Add(p2); pn.Places.Add(p1); pn.Places.Add(p2); pn.Places.Add(p3); pn.Transitions.Add(t1); pn.Transitions.Add(t2); }
private void AssertOneWayUpdatesPetriNetToFsm(Pn.Place p1, Fsm.State p1State) { if (p1 == null) return; p1.Id = "foo2"; Assert.AreEqual("foo2", p1State.Name); Assert.IsFalse(p1State.IsEndState); var t = new Pn.Transition(); t.From.Add(p1); pn.Transitions.Add(t); Assert.IsTrue(p1State.IsEndState); }