Esempio n. 1
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);
    }
Esempio n. 2
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);
    }
Esempio n. 3
0
    public void TestBaseTime()
    {
        Element  pipeline = ElementFactory.Make("pipeline", "pipeline");
        FakeSrc  fakesrc  = FakeSrc.Make("fakesrc");
        FakeSink fakesink = FakeSink.Make("fakesink");

        Assert.IsNotNull(pipeline, "Could not create pipeline");
        Assert.IsNotNull(fakesrc, "Could not create fakesrc");
        Assert.IsNotNull(fakesink, "Could not create fakesink");

        fakesrc.IsLive = true;

        Bin bin = (Bin)pipeline;

        bin.Add(fakesrc, fakesink);
        Assert.IsTrue(fakesrc.Link(fakesink));

        Pad sink = fakesink.GetStaticPad("sink");
    }