public void GetSourcesTest() { Model.PetriNet.PetriNet testNet = new Model.PetriNet.PetriNet("TestNet"); Transition testTransition1 = testNet.AddTransition("TestTransition1"); Transition testTransition2 = testNet.AddTransition("TestTransition2"); testTransition2.AddIncomingPlace(new Place()); Place testPlace1 = testNet.AddPlace("TestPlace1"); Place testPlace2 = testNet.AddPlace("TestPlace2"); testPlace2.AppendIncomingTransition(testTransition1); List <Node> list = testNet.GetSources(); Assert.IsTrue(list.Contains(testTransition1)); Assert.IsTrue(list.Contains(testPlace1)); Assert.AreEqual(2, list.Count); }
public void GetSourcesTest() { Model.PetriNet.PetriNet testNet = new Model.PetriNet.PetriNet("TestNet"); Transition testTransition1 = testNet.AddTransition("TestTransition1"); Transition testTransition2 = testNet.AddTransition("TestTransition2"); testTransition2.AddIncomingPlace(new Place()); Place testPlace1 = testNet.AddPlace("TestPlace1"); Place testPlace2 = testNet.AddPlace("TestPlace2"); testPlace2.AppendIncomingTransition(testTransition1); List<Node> list = testNet.GetSources(); Assert.IsTrue(list.Contains(testTransition1)); Assert.IsTrue(list.Contains(testPlace1)); Assert.AreEqual(2, list.Count); }