Exemple #1
0
  public void TestAdd() {
    Bin bin = new Bin ("test-bin");
    Element e1 = new FakeSrc ("fakesrc");
    Element e2 = new FakeSink ("fakesink");

    Assert.IsNotNull (bin, "Could not create bin");
    Assert.IsNotNull (e1, "Could not create fakesrc");
    Assert.IsNotNull (e2, "Could not create fakesink");

    bin.Add (e1, e2);

    Assert.AreEqual (bin.ChildrenCount, 2);
  }
Exemple #2
0
  public void TestAddRemove() {
    Bin bin = ElementFactory.Make ("bin") as Bin;
    Assert.IsNotNull (bin, "Could not create bin");

    Element e1 = new FakeSrc ("fakesrc");
    Element e2 = new Identity ("identity");
    Element e3 = new FakeSink ("fakesink");

    Assert.IsNotNull (e1, "Could not create fakesrc");
    Assert.IsNotNull (e2, "Could not create identity");
    Assert.IsNotNull (e3, "Could not create fakesink");

    bin.Add (e1, e2, e3);
    Element.Link (e1, e2, e3);

    Assert.AreEqual (bin.ChildrenCount, 3);
    bin.Remove (e2, e3);
    Assert.AreEqual (bin.ChildrenCount, 1);
    bin.Add (e2);
    Assert.AreEqual (bin.ChildrenCount, 2);
    bin.Remove (e1, e2);
    Assert.AreEqual (bin.ChildrenCount, 0);
  }