public void UIATestObject_SetContext() { UIATestObject testObject = new UIATestObject(); testObject.SetContext(new MockContextClass() { ContextName = "MockContext1" }); testObject.SetContext(new MockContextClass2() { ContextName = "MockContext2" }); MockContextClass context = testObject.GetContext <MockContextClass>(); MockContextClass2 context2 = testObject.GetContext <MockContextClass2>(); Assert.AreEqual("MockContext1", context.ContextName); Assert.AreEqual("MockContext2", context2.ContextName); }
public void AppModelManager_LoadFull() { AppModel model; ModelLoadLevel loadLevel = ModelLoadLevel.Full; model = AppModelManager.Load("CalcAppModel.json", loadLevel); UIATestObject testObject = (UIATestObject)model.FindFirst(DescriptorKeys.NodeName, "result"); Assert.AreNotEqual(null, testObject); UIACondition condition = testObject.GetContext <UIACondition>(); //TODO validate the content }
public void UIACondition_CachedProperties() { ObjectDescriptor descriptor = ObjectDescriptor.FromJson( @" { ntype: ""uia"", nname: ""button1"", identifyProperties:{""name"": ""1""}, cachedProperties:{""className"": ""QWidget""}, description: ""button"" }" ); UIATestObject testObject = UIATestObject.ToTestObject(descriptor); CachedPropertyGroup cachedGroup = testObject.GetContext <CachedPropertyGroup>(); Assert.AreNotEqual(null, cachedGroup); UIACondition condition = new UIACondition(testObject); Assert.AreEqual(1, condition.CachedProperties.Count); }