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


C# TechTalk类代码示例

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


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

示例1: ThenIShouldSeeTheFollowingData

 public void ThenIShouldSeeTheFollowingData(TechTalk.SpecFlow.Table table)
 {
     foreach (var header in table.Header)
     {
         Assert.AreEqual(_browser.Element(header).Text, table.Rows[0][header]);
     }
 }
开发者ID:NehadHajjaj,项目名称:AccountManager,代码行数:7,代码来源:PageInteraction.cs

示例2: GivenIAmRegisteredWithTheFollowingData

        public void GivenIAmRegisteredWithTheFollowingData(TechTalk.SpecFlow.Table table)
        {
            var tableSerialized = new SerializableTable(table);
            username = tableSerialized.Rows[0]["email"];
            password = tableSerialized.Rows[0]["password"];
            //mobile = tableSerialized.Rows[0]["mobile"];
            //gender = tableSerialized.Rows[0]["gender"];

            Deleporter.Run(() =>
            {
                var mockRepository = new Mock<IRegisterRepository>();
                mockRepository.Setup(x => x.Get(tableSerialized.Rows[0]["email"]))
                    .Returns((from row in tableSerialized.Rows
                              select new RegisterEntry
                              {
                                  Name = tableSerialized.Rows[0]["name"],
                                  Password = tableSerialized.Rows[0]["password"],
                                  Email = tableSerialized.Rows[0]["email"],
                                  Mobile = tableSerialized.Rows[0]["mobile"],
                                  Gender = Convert.ToChar(tableSerialized.Rows[0]["gender"][0]),
                                  Activated = tableSerialized.Rows[0]["activated"] == "yes" ? true : false
                              }).ToList()[0]);
                NinjectControllerFactoryUtils.TemporarilyReplaceBinding<IRegisterRepository>(mockRepository.Object);
            });
            //ScenarioContext.Current.Pending();
        }
开发者ID:NarimanSami,项目名称:AccountManager,代码行数:26,代码来源:AccountDataManagementSteps.cs

示例3: ThenTheNewlyCreatedTaskIsDisplayedInTheList

 public void ThenTheNewlyCreatedTaskIsDisplayedInTheList(TechTalk.SpecFlow.Table table)
 {
     foreach (var tableRow in table.Rows)
     {
         Assert.IsTrue(WebBrowser.Current.ContainsText(tableRow["Value"]));
     }
 }
开发者ID:Dzejms,项目名称:GPD,代码行数:7,代码来源:AddTaskSteps.cs

示例4: WhenIAdoptForThesePets

        public void WhenIAdoptForThesePets(TechTalk.SpecFlow.Table petNames)
        {
            IWebDriver driver = ScenarioContext.Current["driver"] as IWebDriver;

            for (int i = 0; i < petNames.RowCount; i++)
            {
                ReadOnlyCollection<IWebElement> nameLabels = driver.FindElements(By.ClassName("name"));
                ReadOnlyCollection<IWebElement> viewDetailsButtons = driver.FindElements(By.XPath("//input[@value='View Details']"));

                var petName = petNames.Rows[i][0];
                Console.WriteLine("taking care of " + petName);
                for (int j = 0; j < nameLabels.Count; j++)
                {
                    if (nameLabels[j].Text == petName)
                    {
                        Console.WriteLine("FOUND: " + petName);
                        viewDetailsButtons[j].Click();
                        IWebElement adoptMeButton = driver.FindElement(By.XPath("//input[@value='Adopt Me!']"));
                        adoptMeButton.Click();
                        if (petNames.RowCount == i + 1)
                        {
                            IWebElement completeTheAdoptionButton = driver.FindElement(By.XPath("//input[@value='Complete the Adoption']"));
                            completeTheAdoptionButton.Click();
                        }
                        else
                        {
                            IWebElement adoptAnotherButton = driver.FindElement(By.XPath("//input[@value='Adopt Another Puppy']"));
                            adoptAnotherButton.Click();
                        }
                        break;
                    }
                }

            }
        }
开发者ID:drtran,项目名称:aep-specflow,代码行数:35,代码来源:AdoptingMultiplePuppiesSteps.cs

示例5: ScenarioSetup

 public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
 {
     testRunner.OnScenarioStart(scenarioInfo);
     if(this.driver != null)
         ScenarioContext.Current.Add("Driver", this.driver);
     this.sauceRest = new SauceRest("user_name", "access_key", "https://saucelabs.com/rest/v1");
 }
开发者ID:endjin,项目名称:Endjin.Selenium.SpecFlowPlugin,代码行数:7,代码来源:SpecFlowFeature1.feature.cs

示例6: GivenIFillInTheFormAsFollows

 public void GivenIFillInTheFormAsFollows(TechTalk.SpecFlow.Table table)
 {
     foreach (var row in table.Rows) {
         var labelText = row["Label"];
         var value = row["Value"];
         WebBrowser.Current.TextFields.First(Find.ByLabelText(labelText)).TypeText(value);
     }
 }
开发者ID:aitorconde,项目名称:CodeFirstAltairis,代码行数:8,代码来源:RegisterSteps.cs

示例7: ScenarioSetup

 public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
 {
     testRunner.OnScenarioStart(scenarioInfo);
     if(this.driver != null)
         ScenarioContext.Current.Add("Driver", this.driver);
     if(this.container != null)
         ScenarioContext.Current.Add("Container", this.container);
 }
开发者ID:mamax,项目名称:SpecflowFirst,代码行数:8,代码来源:GoogleSearch.feature.cs

示例8: WhenIAdoptForThesePets

 public void WhenIAdoptForThesePets(TechTalk.SpecFlow.Table petNames)
 {
     for (int i = 0; i < petNames.RowCount; i++)
     {
         var petName = petNames.Rows[i][0];
         Console.WriteLine("Adopting " + petName);
         adoptingSteps.adopt_a_pet(petName, petNames.RowCount == i + 1);
     }
 }
开发者ID:drtran,项目名称:aep-specflow,代码行数:9,代码来源:AdoptingMultiplePuppies_2Steps.cs

示例9: GivenIHaveFilledOutTheFormAsFollows

 public void GivenIHaveFilledOutTheFormAsFollows(TechTalk.SpecFlow.Table table)
 {
     foreach (var row in table.Rows)
     {
         var labelText = row["Label"] + ":";
         var value = row["Value"];
         _browser.TextFields.First(Find.ByLabelText(labelText)).TypeText(value);
     }
 }
开发者ID:mustafamg,项目名称:AccountManager,代码行数:9,代码来源:PageInteraction.cs

示例10: ShouldShowFollowingErrorMessages

        public void ShouldShowFollowingErrorMessages(TechTalk.SpecFlow.Table table)
        {
            IWebElement element;

            foreach (TechTalk.SpecFlow.TableRow row in table.Rows)
            {
                element = BrowserUtility.Browser.FindElementWithWait(By.CssSelector("span[data-valmsg-for='" + row["id"] + "']"));
                element.Text.Should().Be(row["value"]);
            }
        }
开发者ID:pauloortins,项目名称:PoPs.Web,代码行数:10,代码来源:InspectionSteps.cs

示例11: TheGeneralRiskAssessmentsTableShouldNotContainTheFollowingData

        public void TheGeneralRiskAssessmentsTableShouldNotContainTheFollowingData(string type, TechTalk.SpecFlow.Table table)
        {
            var searchResultsTable = WebBrowser.Current.Tables.First();
            Assert.AreEqual(table.Rows.Count, searchResultsTable.TableRows.Count());

            foreach (var row in table.Rows)
            {
                Assert.Null(searchResultsTable.FindRow(row["Reference"], 0));
            }
        }
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:10,代码来源:RestrictGeneralRiskAssessmentsBySitesSteps.cs

示例12: FillFieldsWithFollowingData

        public void FillFieldsWithFollowingData(TechTalk.SpecFlow.Table table)
        {
            IWebElement element;

            foreach (TechTalk.SpecFlow.TableRow row in table.Rows)
            {
                element = BrowserUtility.Browser.FindElementWithWait(By.CssSelector("input[id='" + row["id"] + "']"));
                element.SendKeys(row["value"]);
            }
        }
开发者ID:pauloortins,项目名称:PoPs.Web,代码行数:10,代码来源:InputSteps.cs

示例13: WhenIFillInTheUserForm

 public void WhenIFillInTheUserForm(TechTalk.SpecFlow.Table table)
 {
     Thread.Sleep(2500);
     HostUserPage.UserNameField.Value = table.Rows[0]["Value"];
     HostUserPage.FirstNameField.Value = table.Rows[1]["Value"];
     HostUserPage.LastNameField.Value = table.Rows[2]["Value"];
     HostUserPage.DisplayNameField.Value = table.Rows[3]["Value"];
     HostUserPage.EmailField.Value = table.Rows[4]["Value"];
     HostUserPage.PasswordField.Value = table.Rows[5]["Value"];
     HostUserPage.ConfirmPasswordField.Value = table.Rows[5]["Value"];
 }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:11,代码来源:SuperAccountsSteps.cs

示例14: GivenIHaveEnteredValidDataInTheFormFields

        public void GivenIHaveEnteredValidDataInTheFormFields(TechTalk.SpecFlow.Table table)
        {
            foreach (var tableRow in table.Rows)
            {
                var field = WebBrowser.Current.TextField(Find.ByName(tableRow["Field"]));
                if (!field.Exists)
                    Assert.Fail(String.Format("Could not find {0} field on page", field));

                field.TypeText(tableRow["Value"]);
            }
        }
开发者ID:Dzejms,项目名称:GPD,代码行数:11,代码来源:AddTaskSteps.cs

示例15: WtedyMamyWyswietlonaListeWszystkichAlertow

 public void WtedyMamyWyswietlonaListeWszystkichAlertow(TechTalk.SpecFlow.Table table)
 {
     foreach(var row in table.Rows)
     {
         var element = WebBrowser.Current.ElementWithTag("dt", Find.ByText(row["name"]));
         if (!element.Exists)
         {
             Assert.Fail("Lista nie zawiera alertu o nazwie '{0}'", row["name"]);
         }
     }
 }
开发者ID:jarmolkowicz,项目名称:training,代码行数:11,代码来源:ListaAlertowSteps.cs


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