Exemplo n.º 1
0
        public void AppModel_CheckHierarchy()
        {
            ITestObject windowObject = _calcModel.Items[0];

            Assert.AreEqual("calculator", windowObject.NodeName);
            Assert.AreEqual("Calculator", windowObject["name"]);
            Assert.AreEqual(null, windowObject.Parent);
            Assert.AreEqual(10, TestUtility.Count(windowObject.Children));

            //find the button in the hierarchy
            string      key          = "name";
            string      value        = "+";
            ITestObject btnAddObject = windowObject.Find(key, value);

            Assert.AreEqual("plus", btnAddObject.NodeName);
            Assert.AreEqual("Add", btnAddObject.Description);
            Assert.AreEqual(windowObject, btnAddObject.Parent);
        }