当前位置: 首页>>代码示例>>C#>>正文


C# Action.Retry方法代码示例

本文整理汇总了C#中System.Action.Retry方法的典型用法代码示例。如果您正苦于以下问题:C# Action.Retry方法的具体用法?C# Action.Retry怎么用?C# Action.Retry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Action的用法示例。


在下文中一共展示了Action.Retry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test05_Modify_Master_Fields_on_Option_2_Quote_1

        public void Test05_Modify_Master_Fields_on_Option_2_Quote_1()
        {
            Test04_Modify_Option_1_Quote_1();

            #region Modify Master Fields on Option 2 Quote 1 (Master details of Option 3 Quote 1 Change In line)
            TestConsole.SendMessage("Modify Master Fields on Option 2 Quote 1 (Master details of Option 3 Quote 1 Change In line)");
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:2-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.SelectionOptionTab();
            TestConsole.TestSubmission.TestOption.TestQuote.SelectionQuote();

            #region quote master data
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInInputBoxCob = "Direct - Casualty - F";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxCob = "CF";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInInputBoxMoa = "FA";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxMoa = "FA";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInputBoxQuotingOffice = "LON";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxQuotingOffice = "LON";
            #endregion
            
            TestConsole.TestSubmission.TestOption.TestQuote.InputBoxQuotingOffice.Clear();
            TestConsole.TestSubmission.TestOption.TestQuote.InputBoxQuotingOffice.SendKeys(TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInputBoxQuotingOffice);
            _a = () => TestConsole.WebDriver.FindElement(By.CssSelector(TestConsole.GetTypeAheadCssSelector(TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxQuotingOffice)), TestConsole.LongWait3).Click();
            _a.Retry();

            TestConsole.TestSubmission.TestOption.TestQuote.InputBoxLimitCurrency.Clear();
            TestConsole.TestSubmission.TestOption.TestQuote.InputBoxLimitCurrency.SendKeys("AUD");
            _a = () => TestConsole.WebDriver.FindElement(By.CssSelector(TestConsole.GetTypeAheadCssSelector("AUD")), TestConsole.LongWait3).Click();
            _a.Retry();

            _masterSz1XOz2XVz1XQz1 = TestConsole.TestSubmission.TestOption.TestQuote.GetMasterData();
            _slaveSz1XOz2XVz1XQz1 = TestConsole.TestSubmission.TestOption.TestQuote.GetMasterData();
            TestConsole.PrintScreen(TestConsole.TestSubmission.Context2String());
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:3-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.SelectionOptionTab();
            TestConsole.TestSubmission.TestOption.TestQuote.SelectionQuote();
            _masterSz1XOz3XVz1XQz1 = TestConsole.TestSubmission.TestOption.TestQuote.GetMasterData();
            _slaveSz1XOz3XVz1XQz1 = TestConsole.TestSubmission.TestOption.TestQuote.GetMasterData();
            TestConsole.PrintScreen(TestConsole.TestSubmission.Context2String());
            Assert.IsTrue(_masterSz1XOz2XVz1XQz1 == _masterSz1XOz3XVz1XQz1, "Modify Master Fields on Option 2 Quote 1 (Master details of Option 3 Quote 1 Change In line)");
            Assert.IsTrue(_slaveSz1XOz2XVz1XQz1 == _slaveSz1XOz3XVz1XQz1, "Slave updated");
            

            #endregion

            #region assert
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:1-V:1-Q:1";
            TestConsole.TestSubmission.VerifyFieldStatus(
                                                                   cancelEnabled: true,
                                                                   saveEnabled: true,
                                                                   printQuoteEnabled: false);
            TestConsole.TestSubmission.TestOption.VerifyFieldStatus(
                                                                    addOptionEnabled: true,
                                                                    copyOptionEnabled: true,
                                                                    newVersionEnabled: false,
                                                                    addNewQuote: true);
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:1-V:1-Q:2";
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:2-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.VerifyFieldStatus(
                                                                    addOptionEnabled: true,
                                                                    copyOptionEnabled: true,
                                                                    newVersionEnabled: false,
                                                                    addNewQuote: true
                                                                    );
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:2-V:1-Q:2";
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);

            TestConsole.TestSubmission.SubmissionContext = "S:1-O:3-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.VerifyFieldStatus(
                                                                    addOptionEnabled: true,
                                                                    copyOptionEnabled: true,
                                                                    newVersionEnabled: false,
                                                                    addNewQuote: true
                                                                    );
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: false,
                                                                    masterFieldsEnabled: false,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:3-V:1-Q:2";
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: false,
//.........这里部分代码省略.........
开发者ID:Eugene-Murray,项目名称:Contract_Validus,代码行数:101,代码来源:SubmissionUi.cs

示例2: Test04_Modify_Option_1_Quote_1

        public void Test04_Modify_Option_1_Quote_1()
        {
            Test03_Copy_Option2_to_Option3();

            #region Modify Option 1 Quote 1 (No Impact to other Quotes)
            TestConsole.SendMessage("Modify Option 1 Quote 1 (No Impact to other Quotes)");
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:1-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.SelectionOptionTab();
            TestConsole.TestSubmission.TestOption.TestQuote.SelectionQuote();

            #region quote master data
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInInputBoxCob = "Direct - Casualty - F";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxCob = "CF";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInInputBoxMoa = "FA";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxMoa = "FA";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInputBoxQuotingOffice = "LON";
            TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxQuotingOffice = "LON";
            #endregion
            TestConsole.TestSubmission.TestOption.TestQuote.InputBoxQuotingOffice.Clear();
            TestConsole.TestSubmission.TestOption.TestQuote.InputBoxQuotingOffice.SendKeys(TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.KeyInputBoxQuotingOffice);
            _a = () => TestConsole.WebDriver.FindElement(By.CssSelector(TestConsole.GetTypeAheadCssSelector(TestConsole.TestSubmission.TestOption.TestQuote.QuoteMasterData.SelectInputBoxQuotingOffice)), TestConsole.LongWait3).Click();
            _a.Retry();

            var checkData01 = TestConsole.TestSubmission.TestOption.TestQuote.InputBoxQuotingOffice.GetAttribute("value");
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:3-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.SelectionOptionTab();
            TestConsole.TestSubmission.TestOption.TestQuote.SelectionQuote();
            var checkData02 = TestConsole.TestSubmission.TestOption.TestQuote.InputBoxQuotingOffice.GetAttribute("value");
            TestConsole.SendMessage(string.Format("Debug: checkData01:{0},checkData02{1}", checkData01, checkData02));
            Assert.IsFalse(checkData01 == checkData02, "Modify Option 1 Quote 1 (No Impact to other Quotes) - Failed");
            TestConsole.SendMessage("Modify Option 1 Quote 1 (No Impact to other Quotes) - Success");
            #endregion

            #region assert
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:1-V:1-Q:1";
            TestConsole.TestSubmission.VerifyFieldStatus(
                                                                   cancelEnabled: true,
                                                                   saveEnabled: true,
                                                                   printQuoteEnabled: false);
            TestConsole.TestSubmission.TestOption.VerifyFieldStatus(
                                                                    addOptionEnabled: true,
                                                                    copyOptionEnabled: true,
                                                                    newVersionEnabled: false,
                                                                    addNewQuote: true);
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:1-V:1-Q:2";
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:2-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.VerifyFieldStatus(
                                                                    addOptionEnabled: true,
                                                                    copyOptionEnabled: true,
                                                                    newVersionEnabled: false,
                                                                    addNewQuote: true
                                                                    );
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:2-V:1-Q:2";
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: true,
                                                                    masterFieldsEnabled: true,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);

            TestConsole.TestSubmission.SubmissionContext = "S:1-O:3-V:1-Q:1";
            TestConsole.TestSubmission.TestOption.VerifyFieldStatus(
                                                                    addOptionEnabled: true,
                                                                    copyOptionEnabled: true,
                                                                    newVersionEnabled: false,
                                                                    addNewQuote: true
                                                                    );
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: false,
                                                                    masterFieldsEnabled: false,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:3-V:1-Q:2";
            TestConsole.TestSubmission.TestOption.TestQuote.VerifyFieldStatus(
                                                                    cobFieldEnabled: false,
                                                                    masterFieldsEnabled: false,
                                                                    slaveFieldsEnabled: true,
                                                                    slaveUpdated: true);


            #endregion
            //Final context,
            TestConsole.TestSubmission.SubmissionContext = "S:1-O:3-V:1-Q:1";
        }
开发者ID:Eugene-Murray,项目名称:Contract_Validus,代码行数:98,代码来源:SubmissionUi.cs


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