예제 #1
0
        public void InitialStateIdentical2()
        {
            var sm1 = CookingHoodProgram.SetupCookingHood();
            var sm2 = CookingHoodProgram.SetupCookingHoodFluent();

            AssertThatStateMachinesAreEquivalent(sm1, sm2);
        }
예제 #2
0
        public void RandomEventsStateMachinesEquivalent2()
        {
            var sm1 = CookingHoodProgram.SetupCookingHood();
            var sm2 = CookingHoodProgram.SetupCookingHoodFluent();

            var possibleEvents = new string[]
            {
                "PLUS",
                "MINUS"
            };

            var rand = new Random();

            var executedEvents = new List <string>();

            for (int i = 0; i < 100000; i++)
            {
                var ev = possibleEvents[rand.Next(0, possibleEvents.Length)];
                sm1.ProcessEvent(new Event(ev));
                sm2.ProcessEvent(new Event(ev));
                executedEvents.Add(ev);
                AssertThatStateMachinesAreEquivalent(sm1, sm2);
            }
        }