• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# TestManager.TestCaseAttribute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Test.UIAutomation.TestManager.TestCaseAttribute的典型用法代码示例。如果您正苦于以下问题:C# TestCaseAttribute类的具体用法?C# TestCaseAttribute怎么用?C# TestCaseAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TestCaseAttribute类属于Microsoft.Test.UIAutomation.TestManager命名空间,在下文中一共展示了TestCaseAttribute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: NarratorScenario1

        public void NarratorScenario1(TestCaseAttribute testCase)
        {
            HeaderComment(testCase);

            // blah blah blah...

        }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:7,代码来源:Narrator.cs


示例2: GetBoundingRect1

        public void GetBoundingRect1(TestCaseAttribute testAttribute)
        {
            HeaderComment(testAttribute);
            Rect rect;
            Rect parentRect = m_le.Current.BoundingRectangle;

            if (!m_le.Current.IsOffscreen)
            {
                if (parentRect.Width == 0)
                    ThrowMe(CheckType.Verification, "TitleBar Width cannot be zero");

                if (parentRect.Height == 0)
                    ThrowMe(CheckType.Verification, "TitleBar Height cannot be zero");
            }

            foreach (AutomationElement child in m_le.FindAll(TreeScope.Subtree, Condition.TrueCondition))
            {
                rect = child.Current.BoundingRectangle;

                if (rect.Width == 0)
                    ThrowMe(CheckType.Verification, "{0}'s Width cannot be zero", child.Current.Name);

                if (rect.Height == 0)
                    ThrowMe(CheckType.Verification, "{0}'s Height cannot be zero", child.Current.Name);

                if (Rect.Intersect(parentRect, rect) != rect)
                    ThrowMe(CheckType.Verification, "{0}'s BoundingRectangle is not within the parents BoundingRectangle", child.Current.Name);
            }
            
            m_TestStep++;

        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:32,代码来源:titlebar.cs


示例3: AutomationTest

        /// <summary>
        /// initializes new instance with the testPriority and testType
        /// </summary>
        public AutomationTest(AutomationTest originalTest, TestPriorities testPriority, TestTypes testType)
        {
            this.TestCaseAttribute = originalTest.TestCaseAttribute;
            this.Method = originalTest.Method;

            this._testPriority = testPriority;
            this._testType = testType;
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:11,代码来源:AutomationTest.cs


示例4: TestNode

 public TestNode(XmlDocument document, int step, string message, string methodName, bool isClientSideProvider, TestCaseAttribute testCaseAttribute, string verificationMethod, string controlPath)
 {
     Document = document;
     Step = step; MethodName = methodName; IsClientSideProvider = isClientSideProvider.ToString().Substring(0, 1).ToUpper();
     Attribute = testCaseAttribute;
     VerificationMethod = verificationMethod;
     ControlPath = controlPath;
     Message = message;
 }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:9,代码来源:BugLibrary.cs


示例5: Layout1

        public void Layout1(TestCaseAttribute testCaseAttribute)
        {
            HeaderComment(testCaseAttribute);

            // "Precondition: This is a vertical scrollbar",
            TSC_VerifyPropertyEqual(m_le.GetCurrentPropertyValue(AutomationElement.OrientationProperty), OrientationType.Vertical, AutomationElement.OrientationProperty, CheckType.IncorrectElementConfiguration);

            // "If this is a non Right to Left layout, the bounding rectangle will be on the right side, if Right to Left, bounding rectangle will be on the left side of the parent control",
            TS_VerifyLayout(m_le, CheckType.Verification);
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:10,代码来源:ScrollBar.cs


示例6: StartTestInfo

        /// <summary>
        /// 
        /// </summary>
        /// <param name="xmlNodeObjectID">XmlNode that idetifies the object to test.  This can be as simple as the name of the control, to a node that represents the path</param>
        /// <param name="testCaseAttribute"></param>
        /// <param name="methodInfo">MethodInfo of the method of the test</param>
        public StartTestInfo(XmlNode xmlNodeObjectID, TestCaseAttribute testCaseAttribute, MethodInfo methodInfo)
        {
            this.XmlNodeObjectID = xmlNodeObjectID; 
            this.TestAttribute = testCaseAttribute;
            this.MethodInfo = methodInfo;

            StringBuilder possibleIssuesMessageBuilder = new StringBuilder();

            this.PossibleIssuesMessage = possibleIssuesMessageBuilder.ToString();
        }
开发者ID:jeffras,项目名称:uiverify,代码行数:16,代码来源:starttestinfo.cs


示例7: StaticsDontHaveLabels

        public void StaticsDontHaveLabels(TestCaseAttribute testCaseAttribute)
        {
            HeaderComment(testCaseAttribute);

            //"Precondition: Classname is 'Static'",
            TSC_VerifyPropertyEqual(m_le.Current.ClassName.ToLower(), "static", AutomationElement.ClassNameProperty, CheckType.IncorrectElementConfiguration);

            //"Verify: LabeledBy == null",
            TSC_VerifyPropertyEqual(m_le.Current.LabeledBy, null, AutomationElement.LabeledByProperty, CheckType.Verification);

        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:11,代码来源:Text.cs


示例8: AccessOneCharacter

        public void AccessOneCharacter(TestCaseAttribute testCaseAttribute)
        {
            HeaderComment(testCaseAttribute);

            //"Precondition: There is an access key character",
            TSC_VerifyProperty(m_le.Current.AccessKey.Length, 0, false, AutomationElement.AcceleratorKeyProperty, CheckType.IncorrectElementConfiguration);

            //"Verify: AccessKey length must be one character in length",
            TSC_VerifyProperty(m_le.Current.AccessKey.Length, 1, true, AutomationElement.AcceleratorKeyProperty, CheckType.Verification);

        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:11,代码来源:MenuItem.cs


示例9: IsTextPatternAvailableProperty1

        public void IsTextPatternAvailableProperty1(TestCaseAttribute testCaseAttribute)
        {
            HeaderComment(testCaseAttribute);

            // "Precondition: Element has a valid hwnd",
            TSC_VerifyProperty(m_le.Current.NativeWindowHandle, 0, false, AutomationElement.NativeWindowHandleProperty, CheckType.IncorrectElementConfiguration);

            // "Verification: HelpTextProeprty != null",
            TSC_VerifyProperty(m_le.Current.FrameworkId, "Win32", true, AutomationElement.FrameworkIdProperty, CheckType.IncorrectElementConfiguration);

            // "Verification: HelpTextProeprty != \"\"",
            TSC_VerifyPropertyEqual((bool)m_le.GetCurrentPropertyValue(AutomationElement.IsTextPatternAvailableProperty), false, AutomationElement.IsTextPatternAvailableProperty, CheckType.Verification);
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:13,代码来源:Text.cs


示例10: MsaaScenario1

        public void MsaaScenario1(TestCaseAttribute testCase)
        {
            HeaderComment(testCase);
            _errorList = new ArrayList();
            GetProperties(m_le, true, false, "1");
            if (_errorList.Count != 0)
            {
                string error = "";
                foreach (string s in _errorList)
                    error += s + "\n";

                ThrowMe(CheckType.Verification, error);
            }
        }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:14,代码来源:Msaa.cs


示例11: TestGridItemContainingGridPropertyS11

        public void TestGridItemContainingGridPropertyS11(TestCaseAttribute checkType)
        {
            HeaderComment(checkType);
            AutomationElement grid1 = null;
            AutomationElement grid2 = null;

            //"Step: Traverse up the tree to find a AutomationElement that supports GridPattern",
            TS_GetContainGridByNavigation(m_le, out grid1, CheckType.Verification);

            //"Step: Get the ContainingGrid property",
            TS_GetContainGridByCall(out grid2, CheckType.Verification);

            //"Step: Verify that the two AutomationElements are the same"
            TS_AreTheseTheSame(grid1, grid2, true, CheckType.Verification);
        }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:15,代码来源:GridItemTests.cs


示例12: TestMenuStructureAndNames

        public void TestMenuStructureAndNames(TestCaseAttribute testCase, object[] arguments)
        {
            XmlDocument doc = new XmlDocument();

            if (arguments == null)
                throw new ArgumentException();

            string xml = (string)arguments[0];

            //"Step: Load the argument into an XmlDocument",
            TS_LoadMenuDefinition(xml, ref doc, CheckType.Verification);

            //"Verify: That the menu tree matches the XmlDocument tree structure by name"
            TestMenu menuBar = _appCommands.GetIWUIMenuCommands().GetMenuBar().GetFirstSubMenu();
            TS_VerifyXmlToTree(doc.DocumentElement.FirstChild, menuBar);

        }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:17,代码来源:Menu.cs


示例13: XmlTestInfo

        private XmlTestInfo(
            TestCaseAttribute testCaseAttribute, 
            MethodInfo methodInfo,
            XmlNode xmlElementPathNode)
        {
            this.Name = testCaseAttribute.TestName;
            this.Summary = testCaseAttribute.TestSummary;
            this.Priority = testCaseAttribute.Priority.ToString();
            this.Status = testCaseAttribute.Status.ToString();
            this.Author = testCaseAttribute.Author;
            this.TestCaseType = testCaseAttribute.TestCaseType.ToString();
            this.Description = testCaseAttribute.Description;
            
            if (methodInfo != null)
            {
                this.MethodInfo.AssemblyFile = methodInfo.DeclaringType.Assembly.FullName;
                this.MethodInfo.Class = methodInfo.DeclaringType.FullName;
                this.MethodInfo.Method = methodInfo.Name;
            }

            this.ElementInfo = new XmlTestElementInfo(xmlElementPathNode); 
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:22,代码来源:xmltestinfo.cs


示例14: TstToolTipClosedEvent1

        public void TstToolTipClosedEvent1(TestCaseAttribute testCase)
        {
            HeaderComment(testCase);
            AutomationElement tooltip = null;
            Exception errorThrown = null;
            try
            {

                // "Step: Move mouse 
                ATGTestInput.Input.MoveTo(new Point(500, 500)); m_TestStep++;

                // "Step: Get the Start menu button",
                TS_GetStartMenuButton(ref m_le, CheckType.Verification);

                // Precondition: Verify that the start menu is visible",
                TSC_VerifyPropertyEqual(m_le.Current.IsOffscreen, false, AutomationElement.IsOffscreenProperty, CheckType.IncorrectElementConfiguration);

                // "Step: Add WindowOpenedEvent listener for application",
                TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.ToolTipOpenedEvent, TreeScope.Subtree, CheckType.Verification);

                // "Step: Add ToolTipClosedEvent listener for application",
                TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.ToolTipClosedEvent, TreeScope.Element | TreeScope.Subtree, CheckType.Verification);

                Thread.Sleep(1000);

                // "Step: Move the mouse to the middle of the Start menu button so that an AutomationElement.ToolTipOpenedEvent is fired",
                TS_MoveTo(m_le, CheckType.Verification);

                // "Step: Find the corrent tooltip",
                // Sometimes the tooltip won't come up so if this happens, just bail for now and catch it the next time we run
                TS_ToolTipCurrentlyOpened(TreeWalker.ControlViewWalker.GetParent(m_le), ref m_le, CheckType.IncorrectElementConfiguration);

                // "Step: Move mouse to the 256,0, so that ToolTipClosedEvent can be fired.
                ATGTestInput.Input.MoveTo(new Point(256, 256)); m_TestStep++;

                // "Step: Wait for one event to occur
                //waiting for 5 seconds here because that's how long it takes for tooltipevents to propagate.
                TSC_WaitForEvents(5);

                // "Verify: That the ToolTipOpenedEvent is fired for the application"
                TSC_VerifyEventListener(m_le, AutomationElement.ToolTipOpenedEvent, EventFired.True, CheckType.Verification);

                // "Verify: That the ToolTipClosedEvent is fired for the application"
                TSC_VerifyEventListener(tooltip, AutomationElement.ToolTipClosedEvent, EventFired.True, CheckType.Verification);

            }
            catch (Exception error)
            {
                errorThrown = error;
            }
            finally
            {
                // Precondition: Remove all listeners
                TS_RemoveAllListeners(CheckType.Verification);

                if (errorThrown != null)
                {
                    throw errorThrown;
                }
            }
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:61,代码来源:TopLevelEvents.cs


示例15: TstMenuClosedEvent1

        public void TstMenuClosedEvent1(TestCaseAttribute testCase, object[] arguments)
        {
            //TODO: this case passes, but it crashes the application, looks like there is a UIA bug, that when
            //it's monitoring the MenuClosedEvent, it crashes when an event takes place.
            //bug filed: 1286276 
            Library.ValidateArgumentNonNull(testCase, "testCase");
            Library.ValidateArgumentNonNull(arguments, "arguments");
            Library.ValidateArgumentNonNull(arguments[0], "arguments[0]");
            string appPath = (string)arguments[0];
            Exception cachedException = null;

            AutomationElement menu = null;

            HeaderComment(testCase);

            // "Step: Start the application",
            TS_OpenWindow(appPath, null, CheckType.Verification);

            try
            {
                // "Step: Add WindowOpenedEvent listener for application",
                TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.MenuClosedEvent, TreeScope.Element, CheckType.Verification);

                // "Step: Get the menu",
                TS_GetMenu(MENU_FILE, m_le, out menu, CheckType.Verification);

                // "Step: Expand the menu",
                TS_ExpandMenu(menu, CheckType.Verification);

                // "Step: Collapse the menu",
                TS_CollapseMenu(menu, CheckType.Verification);

                // "Step: Wait for one event to occur
                TSC_WaitForEvents(1);

                // "Verify: WindowOpenedEvent is fired",
                TSC_VerifyEventListener(null, AutomationElement.MenuClosedEvent, EventFired.True, CheckType.Verification);
            }
            catch (Exception error)
            {
                cachedException = error;
            }
            finally
            {
                // "Cleanup: Close the application",
                if (m_le != null)
                    TS_CloseWindow(m_le, CheckType.Verification);

                if (cachedException != null)
                    throw cachedException;
            }
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:52,代码来源:TopLevelEvents.cs


示例16: TstMenuOpenedEvent3

        public void TstMenuOpenedEvent3(TestCaseAttribute testCase, object[] arguments)
        {
            Library.ValidateArgumentNonNull(testCase, "testCase");
            Library.ValidateArgumentNonNull(arguments, "arguments");
            Library.ValidateArgumentNonNull(arguments[0], "arguments[0]");
            string appPath = (string)arguments[0];

            Exception cachedException = null;
            AutomationElement menu = null;

            HeaderComment(testCase);

            // "Step: Start the application",
            TS_OpenWindow(appPath, null, CheckType.Verification);

            try
            {
                // "Step: Add MenuOpenedEvent listener for application",
                TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.MenuOpenedEvent, TreeScope.Subtree, CheckType.Verification);

                // "Step: Invoke the font dialog in notepad.exe by using the keys Alt, O
                TS_PressKeys(true, Key.LeftAlt, Key.O);

                // "Step: Wait for one event to occur
                TSC_WaitForEvents(1);

                // "Step: Get the format menu",
                TS_GetMenu(MENU_FORMAT, m_le, out menu, CheckType.Verification);

                // "Verify: That the MenuOpenedEvent is fired for the application"
                TSC_VerifyEventListener(TreeWalker.ControlViewWalker.GetFirstChild(menu), AutomationElement.MenuOpenedEvent, EventFired.True, CheckType.Verification);
            }
            catch (Exception error)
            {
                cachedException = error;
            }
            finally
            {

                // "Step: Press ESC to remove focus from the menu
                TS_PressKeys(true, Key.Escape);

                // "Cleanup: Close the application",
                if (m_le != null)
                    TS_CloseWindow(m_le, CheckType.Verification);

                if (cachedException != null)
                    throw cachedException;
            }
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:50,代码来源:TopLevelEvents.cs


示例17: TstMenuOpenedEvent2

        public void TstMenuOpenedEvent2(TestCaseAttribute testCase)
        {
            Exception cachedException = null;

            HeaderComment(testCase);

            // "Step: Get the Start menu button",
            TS_GetStartMenuButton(ref m_le, CheckType.Verification);

            // Precondition: Verify that the start menu is visible",
            TSC_VerifyPropertyEqual(m_le.Current.IsOffscreen, false, AutomationElement.IsOffscreenProperty, CheckType.IncorrectElementConfiguration);

            // "Step: Add MenuOpenedEvent listener for start button",
            TSC_AddEventListener(AutomationElement.RootElement, AutomationElement.MenuOpenedEvent, TreeScope.Element | TreeScope.Subtree, CheckType.Verification);

            try
            {
                // "Step: Invoke the Start Button",
                TS_InvokePatternInvoke(m_le, CheckType.Verification);

                // "Step: Wait for one event to occur
                TSC_WaitForEvents(1);

                // "Verify: That the WindowOpenedEvent is fired for the application"
                TSC_VerifyEventListener(TreeWalker.ControlViewWalker.GetFirstChild(TreeWalker.ControlViewWalker.GetParent(m_le)), AutomationElement.MenuOpenedEvent, EventFired.True, CheckType.Verification);
            }
            catch (Exception error)
            {
                cachedException = error;
            }
            finally
            {
                // "Step: Press ESC to close the Start Menu"
                TS_PressKeys(true, Key.Escape);

                if (cachedException != null)
                    throw cachedException;
            }
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:39,代码来源:TopLevelEvents.cs


示例18: TstMenuOpenedEvent1

        public void TstMenuOpenedEvent1(TestCaseAttribute testCase, object[] arguments)
        {
            Library.ValidateArgumentNonNull(testCase, "testCase");
            Library.ValidateArgumentNonNull(arguments, "arguments");
            Library.ValidateArgumentNonNull(arguments[0], "arguments[0]");
            string appPath = (string)arguments[0];
            
            AutomationElement fileMenuElement = null;
            Exception cachedException = null; 

            HeaderComment(testCase);

            // "Step: Start the application",
            TS_OpenWindow(appPath, null, CheckType.Verification);

            try
            {
                // "Step: Add WindowOpenedEvent listener for application",
                TSC_AddEventListener(m_le, AutomationElement.MenuOpenedEvent, TreeScope.Subtree, CheckType.Verification);

                // "Find the FileMenu and then expand it.",
                TS_GetMenu(MENU_FILE, m_le, out fileMenuElement, CheckType.Verification);

                // "Step: Expand the 'File' menu",
                TS_ExpandCollapsePatternExpand(fileMenuElement, CheckType.Verification);

                // "Step: Wait for one event to occur
                TSC_WaitForEvents(2);

                // "Verify: That the WindowOpenedEvent is fired for the application"
                // Getting First Child of the FileMenuElement, because that's the source of the event
                TSC_VerifyEventListener(TreeWalker.ControlViewWalker.GetFirstChild(fileMenuElement), AutomationElement.MenuOpenedEvent, EventFired.True, CheckType.Verification);
            }
            catch (Exception error)
            {
                cachedException = error;
            }
            finally
            {
                // "Close the application"
                if (m_le != null)
                    TS_CloseWindow(m_le, CheckType.Verification);

                if (cachedException != null)
                    throw cachedException;
            }
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:47,代码来源:TopLevelEvents.cs


示例19: TstWindowClosedEvent1

        public void TstWindowClosedEvent1(TestCaseAttribute testCase, object[] arguments)
        {
            Library.ValidateArgumentNonNull(testCase, "testCase");
            Library.ValidateArgumentNonNull(arguments, "arguments");
            Library.ValidateArgumentNonNull(arguments[0], "arguments[0]");

            string appPath = (string)arguments[0];

            HeaderComment(testCase);

            // "Step: Start the application",
            TS_OpenWindow(appPath, null, CheckType.Verification);

            // "Step: Add WindowClosedEvent listener for application",
            TSC_AddEventListener(m_le, WindowPattern.WindowClosedEvent, TreeScope.Element, CheckType.Verification);

            // "Step: Close the aplication",
            TS_CloseWindow(m_le, CheckType.Verification);

            // "Step: Wait for one event to occur",
            TSC_WaitForEvents(5);

            // "Verify: That the WindowClosedEvent is fired for the application"
            TSC_VerifyEventListener(null, WindowPattern.WindowClosedEvent, EventFired.True, CheckType.Verification);

        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:26,代码来源:TopLevelEvents.cs


示例20: TstWindowOpenEvent1

        public void TstWindowOpenEvent1(TestCaseAttribute testCase, object[] arguments)
        {
            Library.ValidateArgumentNonNull(testCase, "testCase");
            Library.ValidateArgumentNonNull(arguments, "arguments");
            Library.ValidateArgumentNonNull(arguments[0], "arguments[0]");

            Exception cachedException = null;

            string appPath = (string)arguments[0];

            HeaderComment(testCase);

            // "Step: Add WindowOpenedEvent listener for application",
            TSC_AddEventListener(AutomationElement.RootElement, WindowPattern.WindowOpenedEvent, TreeScope.Children, CheckType.Verification);

            // "Step: Start the application",
            TS_OpenWindow(appPath, null, CheckType.Verification);

            try
            {
                // "Step: Wait for one event to occur
                TSC_WaitForEvents(2);

                // "Verify: That the WindowOpenedEvent is fired for the application"
                TSC_VerifyEventListener(m_le, WindowPattern.WindowOpenedEvent, EventFired.True, CheckType.Verification);
            }
            catch (Exception error)
            {
                cachedException = error;
            }
            finally
            {
                // "Cleanup: Close the application",
                TS_CloseWindow(m_le, CheckType.Verification);

                if (cachedException != null)
                    throw cachedException;
            }
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:39,代码来源:TopLevelEvents.cs



注:本文中的Microsoft.Test.UIAutomation.TestManager.TestCaseAttribute类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WindowsInstallerXml.Output类代码示例发布时间:2022-05-26
下一篇:
C# EntityModel.EntityModelSchema类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap