コード例 #1
0
ファイル: ComponentTest.cs プロジェクト: codehaus/fest-git
        public void TestTree()
        {
            Tree tree = new Tree("newTree");

            Assert.AreEqual("newTree", tree.Name);
            Assert.AreEqual(String.Empty, tree.Text);
            Assert.IsTrue(tree is Component);

            Tree anotherTree = new Tree("anotherTree", "someText");
            Assert.AreEqual("someText", anotherTree.Text);
            Assert.AreEqual("anotherTree", anotherTree.Name);

            Assert.AreEqual("tree", anotherTree.Type);
            Assert.AreEqual("tree(\"anotherTree\")", anotherTree.GetBaseComponentString());
            Assert.AreEqual("getTestFixture().tree(\"anotherTree\")", anotherTree.GetQueryString());
            Assert.AreEqual("getTestFixture().prefix(\"prefix\").tree(\"anotherTree\")", anotherTree.GetQueryString("prefix(\"prefix\")"));
        }