예제 #1
0
파일: BinTest.cs 프로젝트: jwzl/ossbuild
  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);
  }
예제 #2
0
파일: BinTest.cs 프로젝트: jwzl/ossbuild
  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);
  }