예제 #1
0
        public void RemoveNodeTest()
        {
            Model.PetriNet.PetriNet testNet = new Model.PetriNet.PetriNet("TestNet");
            Transition testTransition1      = testNet.AddTransition("TestTransition1");
            Transition testTransition2      = testNet.AddTransition("TestTransition2");
            Place      testPlace1           = testNet.AddPlace("TestPlace1");
            Place      testPlace2           = testNet.AddPlace("TestPlace2");

            testNet.RemoveNode(testTransition1);
            testNet.RemoveNode(testPlace1);

            Assert.AreEqual(1, testNet.Transitions.Count);
            Assert.AreEqual(1, testNet.Places.Count);
            Assert.AreEqual(testTransition2, testNet.Transitions.First());
            Assert.AreEqual(testPlace2, testNet.Places.First());
        }
        public void RemoveNodeTest()
        {
            Model.PetriNet.PetriNet testNet = new Model.PetriNet.PetriNet("TestNet");
            Transition testTransition1 = testNet.AddTransition("TestTransition1");
            Transition testTransition2 = testNet.AddTransition("TestTransition2");
            Place testPlace1 = testNet.AddPlace("TestPlace1");
            Place testPlace2 = testNet.AddPlace("TestPlace2");

            testNet.RemoveNode(testTransition1);
            testNet.RemoveNode(testPlace1);

            Assert.AreEqual(1, testNet.Transitions.Count);
            Assert.AreEqual(1, testNet.Places.Count);
            Assert.AreEqual(testTransition2, testNet.Transitions.First());
            Assert.AreEqual(testPlace2, testNet.Places.First());
        }