public virtual void RegisteringAnUnusedEmailAddress()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Registering an unused email address", ((string[])(null)));
#line 5
this.ScenarioSetup(scenarioInfo);
#line 6
 testRunner.Given("I am on page \"User.Register\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Email",
                        "Name",
                        "Password"});
            table1.AddRow(new string[] {
                        "[email protected]",
                        "Test User2",
                        "password"});
#line 7
 testRunner.When("I submit the form using", ((string)(null)), table1, "When ");
#line 10
 testRunner.Then("A cookie named \".ASPXAUTH\" should exist", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 11
 testRunner.And("I should be redirected to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void AddPizza()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add Pizza", ((string[])(null)));
#line 4
this.ScenarioSetup(scenarioInfo);
#line 5
 testRunner.Given("I have navigated to Pizza/Compose page", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 6
 testRunner.And("I wait 5 seconds", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Name"});
            table1.AddRow(new string[] {
                        "pizzaName"});
#line 7
 testRunner.When("I enter pizza data", ((string)(null)), table1, "When ");
#line 10
 testRunner.And("I have selected ingredients", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 11
 testRunner.And("I press add pizza button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 12
 testRunner.Then("I wait 5 seconds", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 13
 testRunner.And("Should go to Pizza", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void AListContainingSyntax()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("a list containing syntax", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
 testRunner.Given("I am a list specification", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "colours"});
            table1.AddRow(new string[] {
                        "Red"});
            table1.AddRow(new string[] {
                        "Green"});
            table1.AddRow(new string[] {
                        "Blue"});
#line 8
 testRunner.And("I can see the list of available colours", ((string)(null)), table1, "And ");
#line hidden
            TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
                        "colours"});
            table2.AddRow(new string[] {
                        "Red"});
            table2.AddRow(new string[] {
                        "Green"});
            table2.AddRow(new string[] {
                        "Blue"});
#line 13
 testRunner.Then("I should see a list of available colours containing", ((string)(null)), table2, "Then ");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void RegisterUser()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Register User", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
 testRunner.Given("I am on the site home page");
#line 8
 testRunner.When("I click the Register link");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Control",
                        "Value"});
            table1.AddRow(new string[] {
                        "User Name",
                        "RegisterUserTest"});
            table1.AddRow(new string[] {
                        "Email",
                        "[email protected]"});
            table1.AddRow(new string[] {
                        "Password",
                        "password"});
            table1.AddRow(new string[] {
                        "Display Name",
                        "RegisterUserTest DN"});
#line 9
 testRunner.And("I fill in the Register User form", ((string)(null)), table1);
#line 15
 testRunner.And("I click the Register button");
#line 16
 testRunner.Then("I am logged in as the RegisterUserTest DN user");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void FullyArmed()
        {
            var scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Fully armed", ((string[]) (null)));
#line 7
            this.ScenarioSetup(scenarioInfo);
#line hidden
            var table1 = new TechTalk.SpecFlow.Table(new string[]
                                                         {
                                                             "belt_level",
                                                             "katana",
                                                             "sake",
                                                             "fought",
                                                             "magic"
                                                         });
            table1.AddRow(new string[]
                              {
                                  "third",
                                  "two",
                                  "three",
                                  "samurai",
                                  "five"
                              });
#line 8
            testRunner.Given("a ninja with the following experience", ((string) (null)), table1);
#line 11
            testRunner.When("attacked by a samurai");
#line 12
            testRunner.Then("the ninja should engage the opponent");
#line hidden
            testRunner.CollectScenarioErrors();
        }
Example #6
0
 public void ThenIRequestDataThruGetAction(Table table)
 {
     Order expected = table.CreateSet<Order>().Single();
     var actual = (List<Order>)ScenarioContext.Current[ResopnseKey];
     Assert.Equal(1, actual.Count);
     Assert.True(expected.Equals(actual.Single()));
 }
        public virtual void FullyArmed()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Fully armed", ((string[])(null)));
#line 7
  this.ScenarioSetup(scenarioInfo);
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Field",
                        "Value"});
            table1.AddRow(new string[] {
                        "BeltLevel",
                        "third"});
            table1.AddRow(new string[] {
                        "Katana",
                        "two"});
            table1.AddRow(new string[] {
                        "Sake",
                        "three"});
            table1.AddRow(new string[] {
                        "Fought",
                        "samurai"});
            table1.AddRow(new string[] {
                        "Magic",
                        "five"});
#line 8
 testRunner.Given("a ninja with the following parameterized experience", ((string)(null)), table1);
#line 16
 testRunner.When("attacked by a samurai");
#line 17
 testRunner.Then("the ninja should engage the opponent");
#line hidden
            testRunner.CollectScenarioErrors();
        }
Example #8
0
 public void WhenISendDataThruPostWithResponseAction(Table table)
 {
     Order order = table.CreateSet<Order>().Single();
     JsonServiceClient client = GetClient();
     var response = client.Post<bool>(order);
     ScenarioContext.Current[ResopnseKey] = response;
 }
        public void TestGivenNavigateToPageStepWithArguments()
        {
            var testPage = new Mock<IPage>();

            var pipelineService = new Mock<IActionPipelineService>(MockBehavior.Strict);
            pipelineService.Setup(p => p.PerformAction<PageNavigationAction>(
                null,
                It.Is<PageNavigationAction.PageNavigationActionContext>(c => c.PropertyName == "mypage" && 
                    c.PageAction == PageNavigationAction.PageAction.NavigateToPage && 
                    c.PageArguments != null && c.PageArguments.Count == 2)))
                .Returns(ActionResult.Successful(testPage.Object));

            var scenarioContext = new Mock<IScenarioContextHelper>(MockBehavior.Strict);
            scenarioContext.Setup(s => s.SetValue(It.IsAny<IPage>(), PageStepBase.CurrentPageKey));

            var tokenManager = new Mock<ITokenManager>(MockBehavior.Strict);
            tokenManager.Setup(t => t.GetToken(It.IsAny<string>())).Returns<string>(s => s);

            var steps = new PageNavigationSteps(scenarioContext.Object, pipelineService.Object, tokenManager.Object);

            var table = new Table("Id", "Part");
            table.AddRow("1", "A");

            steps.GivenNavigateToPageWithArgumentsStep("mypage", table);

            scenarioContext.VerifyAll();
            pipelineService.VerifyAll();
        }
        public virtual void FeatureBackground()
        {
#line 5
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Forename",
                        "Surname",
                        "PcName"});
            table1.AddRow(new string[] {
                        "Tom",
                        "Jerrum",
                        "DESKTOP-3L5QH7C\\tomje"});
#line 6
 testRunner.Given("I have the following users stored", ((string)(null)), table1, "Given ");
#line hidden
            TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
                        "Title",
                        "Contents",
                        "Author"});
            table2.AddRow(new string[] {
                        "Test 1",
                        "Test blog post 1",
                        "Tom Jerrum"});
#line 9
 testRunner.And("I have the following blog posts stored", ((string)(null)), table2, "And ");
#line 12
 testRunner.And("I am the following user \'DESKTOP-3L5QH7C\\tomje\'", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
        }
        public virtual void WhatIfThereIsNoSpoon()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("What If There Is No Spoon", new string[] {
                        "TutorialNoSpoonSteps"});
#line 7
this.ScenarioSetup(scenarioInfo);
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "First Name",
                        "Last Name"});
            table1.AddRow(new string[] {
                        "Fox",
                        "Smith"});
#line 9
 testRunner.Given("I have a Person", ((string)(null)), table1, "Given ");
#line hidden
            TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
                        "First Name",
                        "Last Name"});
            table2.AddRow(new string[] {
                        "Fox",
                        "Smith"});
#line 13
 testRunner.Then("There is a Person", ((string)(null)), table2, "Then ");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void RevealAllTilesThatArenTMinesAndWinTheGame()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Reveal all tiles that aren\'t mines and win the game", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
 testRunner.Given("I have started a new game \"minefield size of 9 x 9 (10 mines)\"");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Row",
                        "Column"});
            table1.AddRow(new string[] {
                        "2",
                        "2"});
#line 8
 testRunner.And("the minefield contains the following mines:", ((string)(null)), table1);
#line 11
 testRunner.When("I navigate to the game play page");
#line 12
 testRunner.And("I click on the tile at coordinate 2,2");
#line 13
 testRunner.Then("I should see a message telling me that \"You have lost!\"");
#line 14
 testRunner.And("I should see a button labelled \"Start New Game\"");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void CreateANewsManagementArticleInATransaction()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Create a News Management Article in a transaction", ((string[])(null)));
#line 4
this.ScenarioSetup(scenarioInfo);
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "CreatedBy",
                        "Title",
                        "Content"});
            table1.AddRow(new string[] {
                        "Jonathan",
                        "Test Title",
                        "Test Content"});
#line 5
 testRunner.Given("I have a news management article with the properties", ((string)(null)), table1);
#line 8
 testRunner.When("I attempt to create the article in a transaction");
#line 9
 testRunner.Then("the repository result will be true");
#line 10
 testRunner.And("the article repository count should be 1");
#line 11
 testRunner.And("the Creator will be Jonathan");
#line 12
 testRunner.And("the Title will be Test Title");
#line 13
 testRunner.And("the Content will be Test Content");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void FeatureBackground()
        {
#line 7
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Author",
                        "Title",
                        "Price"});
            table1.AddRow(new string[] {
                        "Martin Fowler",
                        "Analysis Patterns",
                        "50.20"});
            table1.AddRow(new string[] {
                        "Eric Evans",
                        "Domain Driven Design",
                        "46.34"});
            table1.AddRow(new string[] {
                        "Ted Pattison",
                        "Inside Windows SharePoint Services",
                        "31.49"});
            table1.AddRow(new string[] {
                        "Gojko Adzic",
                        "Bridging the Communication Gap",
                        "24.75"});
#line 8
 testRunner.Given("the following books", ((string)(null)), table1, "Given ");
#line hidden
        }
        public virtual void FeatureBackground()
        {
#line 3
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "name",
                        "password",
                        "email",
                        "mobile",
                        "gender",
                        "activated"});
            table1.AddRow(new string[] {
                        "Tala",
                        "[email protected]",
                        "[email protected]",
                        "00972598",
                        "Female",
                        "yes"});
#line 4
 testRunner.Given("I am registered with the following data:", ((string)(null)), table1, "Given ");
#line 8
 testRunner.And("I\'m logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 10
 testRunner.And("I am on \"home\" page", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 11
 testRunner.When("I click on \"MyAccount\" link", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
        }
        public virtual void CreateDynamicInstanceFromTableWithOneRow()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Create dynamic instance from table with one row", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Name",
                        "Age",
                        "Birth date",
                        "Length in meters"});
            table1.AddRow(new string[] {
                        "Marcus",
                        "39",
                        "1972-10-09",
                        "1.96"});
#line 7
 testRunner.When("I create a dynamic instance from this table", ((string)(null)), table1);
#line 10
 testRunner.Then("the Name property should equal \'Marcus\'");
#line 11
  testRunner.And("the Age property should equal 39");
#line 12
  testRunner.And("the BirthDate property should equal 1972-10-09");
#line 13
  testRunner.And("the LengthInMeters property should equal 1.96");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void FeatureBackground()
        {
#line 7
#line 8
 testRunner.Given("Setup mocking", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Id",
                        "SecretCode",
                        "Points",
                        "MaximumGuessAmount",
                        "CurrentOrderedCoupon"});
            table1.AddRow(new string[] {
                        "1",
                        "s01",
                        "0",
                        "5",
                        "0"});
            table1.AddRow(new string[] {
                        "2",
                        "s02",
                        "100",
                        "5",
                        "0"});
            table1.AddRow(new string[] {
                        "3",
                        "s03",
                        "10000",
                        "5",
                        "0"});
#line 9
 testRunner.And("ผู้ใช้ในระบบมีดังนี้", ((string)(null)), table1, "And ");
#line hidden
        }
Example #18
0
        public virtual void InstalledModulesAreListed()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Installed modules are listed", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
    testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 8
    testRunner.When("I go to \"admin/modules\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 9
    testRunner.Then("I should see \"<h1 id=\"page-title\">Modules</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "name",
                        "value"});
            table1.AddRow(new string[] {
                        "Options.SearchText",
                        "Themes"});
#line 10
    testRunner.When("I fill in", ((string)(null)), table1, "When ");
#line 13
    testRunner.And("I hit \"Search\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 14
    testRunner.Then("I should see \"<h1 id=\"page-title\">Modules</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 15
        testRunner.And("I should see \"<h2[^>]*>Themes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 16
        testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void FeatureBackground()
        {
#line 5
#line 6
 testRunner.Given("user have entered web browser", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 7
  testRunner.And("he navigates to aplication URL", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 8
  testRunner.And("he also navigates to register subpage", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Id",
                        "Name",
                        "Email"});
            table1.AddRow(new string[] {
                        "1",
                        "Damdud",
                        "[email protected]"});
            table1.AddRow(new string[] {
                        "2",
                        "Deino",
                        "[email protected]"});
            table1.AddRow(new string[] {
                        "3",
                        "Ziachu",
                        "[email protected]"});
#line 9
 testRunner.Given("the following users exist:", ((string)(null)), table1, "Given ");
#line hidden
        }
        public virtual void SchedulingHomePage()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Scheduling home page", new string[] {
                        "selenium"});
#line 7
this.ScenarioSetup(scenarioInfo);
#line 8
 testRunner.When("I navigate to the scheduling area");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Text",
                        "Url"});
            table1.AddRow(new string[] {
                        "ISIS",
                        "http://localhost:1481/"});
            table1.AddRow(new string[] {
                        "Course Scheduling",
                        "http://localhost:1481/Schedule"});
            table1.AddRow(new string[] {
                        "Home",
                        ""});
#line 9
 testRunner.Then("the page has breadcrumbs as follows", ((string)(null)), table1);
#line 14
 testRunner.And("the page has a link to Instructors");
#line 15
 testRunner.And("the page has a link to Templates");
#line 16
 testRunner.And("the page has a link to Sections");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void FeatureBackground()
        {
#line 7
 #line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "numero",
                        "valor"});
            table1.AddRow(new string[] {
                        "1",
                        "10"});
            table1.AddRow(new string[] {
                        "2",
                        "20"});
            table1.AddRow(new string[] {
                        "3",
                        "30"});
            table1.AddRow(new string[] {
                        "4",
                        "40"});
#line 8
  testRunner.Given("os seguintes boletos em aberto no sistema", ((string)(null)), table1, "Dado ");
#line hidden
            TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
                        "numero",
                        "valor"});
            table2.AddRow(new string[] {
                        "10",
                        "100"});
#line 14
  testRunner.And("os seguintes boletos fechados no sistema", ((string)(null)), table2, "E ");
#line hidden
        }
Example #22
0
        public virtual void ICanCreateAndPublishANewPageWithInternationalCharactersInItsRoute()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create and publish a new Page with international characters in its route", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
    testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 8
    testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "name",
                        "value"});
            table1.AddRow(new string[] {
                        "Title.Title",
                        "Χελλο"});
#line 9
        testRunner.And("I fill in", ((string)(null)), table1, "And ");
#line 12
        testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 13
        testRunner.And("I go to \"Χελλο\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 14
    testRunner.Then("I should see \"<h1[^>]*>.*?Χελλο.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
            this.ScenarioCleanup();
        }
        public virtual void DeadCellWith0NeighborsStaysDead()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dead cell with 0 neighbors stays dead", ((string[])(null)));
#line 6
  this.ScenarioSetup(scenarioInfo);
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "*",
                        "*",
                        "*"});
            table1.AddRow(new string[] {
                        ".",
                        ".",
                        "."});
            table1.AddRow(new string[] {
                        ".",
                        ".",
                        "."});
            table1.AddRow(new string[] {
                        ".",
                        ".",
                        "."});
#line 7
    testRunner.Given("the following setup", ((string)(null)), table1);
#line 12
    testRunner.When("I evolve the board");
#line 13
    testRunner.Then("the center cell should be dead");
#line hidden
            testRunner.CollectScenarioErrors();
        }
        public void Thenระบบสงผลการทายผลรายเดอนในสวนของแมชกลบไปเปน(Table table)
        {
            var expecteds = CommonSetup.ConvertToMatchInformationList(table.Rows).OrderBy(it => it.Id).ToList();
            var actuals = ScenarioContext.Current.Get<GetGuessHistoryByMonthRespond>().Histories
                .SelectMany(it => it.Matches)
                .OrderBy(it => it.Id).ToList();

            Assert.AreEqual(expecteds.Count(), actuals.Count(), "Matches element aren't equal");
            for (int elementIndex = 0; elementIndex < expecteds.Count(); elementIndex++)
            {
                var messageMatchInfo = string.Format(" (Match's ID: {0})", expecteds[elementIndex].Id);
                Assert.AreEqual(expecteds[elementIndex].Id, actuals[elementIndex].Id, "Match's Id aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].LeagueName, actuals[elementIndex].LeagueName, "Match's LeagueName aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].Status, actuals[elementIndex].Status, "Match's Status aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].BeginDate, actuals[elementIndex].BeginDate, "Match's BeginDate aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].StartedDate, actuals[elementIndex].StartedDate, "Match's StartedDate aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].CompletedDate, actuals[elementIndex].CompletedDate, "Match's CompletedDate aren't equal" + messageMatchInfo);

                Assert.AreEqual(expecteds[elementIndex].TeamAway.Id, actuals[elementIndex].TeamAway.Id, "Match's TeamAway.Id aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamAway.Name, actuals[elementIndex].TeamAway.Name, "Match's TeamAway.Name aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamAway.IsSelected, actuals[elementIndex].TeamAway.IsSelected, "Match's TeamAway.IsSelected aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamAway.CurrentPredictionPoints, actuals[elementIndex].TeamAway.CurrentPredictionPoints, "Match's TeamAway.CurrentPredictionPoints aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamAway.CurrentScore, actuals[elementIndex].TeamAway.CurrentScore, "Match's TeamAway.CurrentScore aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamAway.WinningPredictionPoints, actuals[elementIndex].TeamAway.WinningPredictionPoints, "Match's TeamAway.WinningPredictionPoints aren't equal" + messageMatchInfo);

                Assert.AreEqual(expecteds[elementIndex].TeamHome.Id, actuals[elementIndex].TeamHome.Id, "Match's TeamHome.Id aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamHome.Name, actuals[elementIndex].TeamHome.Name, "Match's TeamHome.Name aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamHome.IsSelected, actuals[elementIndex].TeamHome.IsSelected, "Match's TeamHome.IsSelected aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamHome.CurrentPredictionPoints, actuals[elementIndex].TeamHome.CurrentPredictionPoints, "Match's TeamHome.CurrentPredictionPoints aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamHome.CurrentScore, actuals[elementIndex].TeamHome.CurrentScore, "Match's TeamHome.CurrentScore aren't equal" + messageMatchInfo);
                Assert.AreEqual(expecteds[elementIndex].TeamHome.WinningPredictionPoints, actuals[elementIndex].TeamHome.WinningPredictionPoints, "Match's TeamHome.WinningPredictionPoints aren't equal" + messageMatchInfo);
            }
        }
Example #25
0
        public void GivenIHaveTheFollowingRecordsetToSort(Table table)
        {
            List<TableRow> tableRows = table.Rows.ToList();

            if(tableRows.Count == 0)
            {
                var rs = table.Header.ToArray()[0];
                var field = table.Header.ToArray()[1];

                List<Tuple<string, string>> emptyRecordset;

                bool isAdded = ScenarioContext.Current.TryGetValue("rs", out emptyRecordset);
                if(!isAdded)
                {
                    emptyRecordset = new List<Tuple<string, string>>();
                    ScenarioContext.Current.Add("rs", emptyRecordset);
                }
                emptyRecordset.Add(new Tuple<string, string>(rs, field));
            }

            foreach(TableRow t in tableRows)
            {
                List<Tuple<string, string>> variableList;
                ScenarioContext.Current.TryGetValue("variableList", out variableList);

                if(variableList == null)
                {
                    variableList = new List<Tuple<string, string>>();
                    ScenarioContext.Current.Add("variableList", variableList);
                }
                variableList.Add(new Tuple<string, string>(t[0], t[1]));
            }
        }
 public void WhenIRoll(Table rolls)
 {
     foreach (var row in rolls.Rows)
     {
         _game.Roll(int.Parse(row["Pins"]));
     }
 }
        public virtual void TheDefaultCultureIsUsedForBindingsIfNotSpecified()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The default culture is used for bindings if not specified", ((string[])(null)));
#line 3
this.ScenarioSetup(scenarioInfo);
#line hidden
#line 4
 testRunner.Given("a scenario \'Simple Scenario\' as", "Given I have entered 3.14 into the calculator", ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line hidden
#line 8
 testRunner.And("the following step definition", "[Given(@\"I have entered (.+) into the calculator\")]\r\npublic void GivenIHaveEntere" +
                    "d(double number)\r\n{\r\nif (number != 3.14) throw new Exception(\"number converted i" +
                    "ncorrectly\");\r\n}", ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 16
 testRunner.When("I execute the tests", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "Succeeded"});
            table1.AddRow(new string[] {
                        "1"});
#line 17
 testRunner.Then("the execution summary should contain", ((string)(null)), table1, "Then ");
#line hidden
            this.ScenarioCleanup();
        }
Example #28
0
        public virtual void RootRequestShowsSetupForm()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Root request shows setup form", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line hidden
            TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
                        "extension",
                        "names"});
            table1.AddRow(new string[] {
                        "Module",
                        "Orchard.Setup, Orchard.Pages, Orchard.ContentPicker, Orchard.Users, Orchard.Roles" +
                            ", Orchard.Messaging, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orc" +
                            "hard.jQuery, TinyMce"});
            table1.AddRow(new string[] {
                        "Core",
                        "Common, Contents, Dashboard, Feeds, Navigation, Scheduling, Settings, Shapes, Xml" +
                            "Rpc, Title"});
            table1.AddRow(new string[] {
                        "Theme",
                        "SafeMode"});
#line 7
    testRunner.Given("I have a clean site with", ((string)(null)), table1, "Given ");
#line 12
    testRunner.When("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 13
    testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 14
        testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 15
        testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
            this.ScenarioCleanup();
        }
        public void Then1(string batchNumber, Table table)
        {
            var task = CheckThirdPartyBus.GetSingleResponseAsync(5);
            task.Wait();

            response = task.Result;

            Assert.IsNotNull(response, "No response received");
            Assert.IsFalse(string.IsNullOrEmpty(response.voucherBatch.scannedBatchNumber));
            Assert.AreEqual(batchNumber, response.voucherBatch.scannedBatchNumber);

            table.CompareToSet(response.voucher.Select(c => new
            {
                documentReferenceNumber = c.voucher.documentReferenceNumber.Trim(),
                bsbNumber = c.voucher.bsbNumber.Trim(),
                accountNumber = c.voucher.accountNumber.Trim(),
                auxDom = c.voucher.auxDom.Trim(),
                extraAuxDom = c.voucher.extraAuxDom.Trim(),
                transactionCode = c.voucher.transactionCode.Trim(),
                amount = c.voucher.amount.Trim(),
                
                //targetEndPoint = c.voucher.targetEndPoint.Trim(),
                //unprocessable = c.voucher.unprocessable,
                //repostFromDRN = c.voucher.repostFromDRN,
                //repostFromProcessingDate = c.voucher.repostFromProcessingDate.ToString("yyyyMMdd")
            }));
        }
        public void WhenManyRegistrantsSelectsTheseOrderItems(int registrants, Table table)
        {
            Func<string> worker = () =>
            {
                using (var registrant = new SelfRegistrationEndToEndWithControllersSteps())
                {
                    try
                    {
                        registrant.GivenTheSelectedOrderItems(table);
                        registrant.GivenTheRegistrantProceedToMakeTheReservation();
                        //If we get here, the reservation was successful so proceeds to payment
                        registrant.GivenTheRegistrantProceedToCheckoutPayment();
                        registrant.WhenTheRegistrantProceedToConfirmThePayment();
                        registrant.ThenTheOrderShouldBeCreatedWithTheFollowingOrderItems(table);
                    }
                    catch (AssertException e)
                    {
                        return e.Message;
                    }
                    return null; // all went fine so nothing to report.
                }
            };

            Task<string>[] tasks = Enumerable.Range(0, registrants).Select(i => Task.Factory.StartNew(worker)).ToArray();
            Task.WaitAll(tasks);

            results = tasks.Select(t => t.Result).ToList();
        }