예제 #1
0
        public void AncestorTest()
        {
            // Passing in the top-level simulations object should return null.
            Assert.Null(simulations.FindAncestor <IModel>());

            // Passing in an object should never return that object
            Assert.AreNotEqual(simulation, simulation.FindAncestor <Simulation>());

            // Searching for any IModel ancestor should return the node's parent.
            Assert.AreEqual(simulation.Parent, simulation.FindAncestor <IModel>());
        }