Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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 + "  "));
            }
        }
Exemplo n.º 3
0
 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));
 }