public virtual void AddTransition(State @from, State to, TEvent e) { if (!States.Contains(@from)) { throw new StateNotFoundException(); } if (States.Add(to)) { LastAdded = to; } Events.Add(e); }
private void Produce <T>(Bag <T> bag, string indent) { var id = DataBinding.GetId <T>(bag); if (!StateSet.Contains(id)) { Console.WriteLine(indent + id); bag.Accept(new Visitor <T>(this, indent + " ")); } }
protected static void AssertEqual(StateSet <string> expected, StateSet <string> got) { Assert.Equal(expected.Count, got.Count); Assert.All(expected, e => got.Contains(e)); Assert.All(got, s => expected.Contains(s)); }