예제 #1
0
        public void GetTransitionsWithoutFollowersIgnoreLoopsTest()
        {
            Model.PetriNet.PetriNet testNet = new Model.PetriNet.PetriNet("TestNet");
            Transition testTransition1      = testNet.AddTransition("TestTransition1");
            Transition testTransition2      = testNet.AddTransition("TestTransition2");
            Transition testTransition3      = testNet.AddTransition("TestTransition3");

            testNet.AddTransition("TestTransition4");
            testTransition1.AddOutgoingPlace(new Place());
            testTransition2.AddOutgoingPlace(new Place());
            Place testPlace = new Place();

            testTransition3.AddOutgoingPlace(testPlace);
            testPlace.AppendOutgoingTransition(new Transition("", isLoop: true));

            List <Transition> testList = testNet.GetTransitionsWithoutFollowersIgnoreLoops();

            Assert.IsNotNull(testList);
            Assert.AreEqual(testTransition3, testList.First());
            Assert.AreEqual(2, testList.Count);
        }
        public void GetTransitionsWithoutFollowersIgnoreLoopsTest()
        {
            Model.PetriNet.PetriNet testNet = new Model.PetriNet.PetriNet("TestNet");
            Transition testTransition1 = testNet.AddTransition("TestTransition1");
            Transition testTransition2 = testNet.AddTransition("TestTransition2");
            Transition testTransition3 = testNet.AddTransition("TestTransition3");
            testNet.AddTransition("TestTransition4");
            testTransition1.AddOutgoingPlace(new Place());
            testTransition2.AddOutgoingPlace(new Place());
            Place testPlace = new Place();
            testTransition3.AddOutgoingPlace(testPlace);
            testPlace.AppendOutgoingTransition(new Transition("", isLoop: true));

            List<Transition> testList = testNet.GetTransitionsWithoutFollowersIgnoreLoops();

            Assert.IsNotNull(testList);
            Assert.AreEqual(testTransition3, testList.First());
            Assert.AreEqual(2, testList.Count);
        }