--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-05-13 19:11:16 -07:00
2 changed files with 72 additions and 66 deletions

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
@@ -159,7 +160,7 @@ namespace Orchard.Specs.Bindings {
var r = row; var r = row;
var input = inputs.First(x => x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]); var input = inputs.First(x => x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]);
Assert.That(input, Is.Not.Null, "Unable to locate <input> name {0} in page html:\r\n\r\n{1}", r["name"], Details.ResponseText); Assert.That(input, Is.Not.Null, "Unable to locate <input> name {0} in page html:\r\n\r\n{1}", r["name"], Details.ResponseText);
var inputType = input.Attributes["type"].Value.ToLowerInvariant(); var inputType = input.GetAttributeValue("type", "");
switch(inputType) { switch(inputType) {
case "radio": case "radio":
var radios = inputs.Where( var radios = inputs.Where(
@@ -190,6 +191,7 @@ namespace Orchard.Specs.Bindings {
var urlPath = form.Start.GetAttributeValue("action", Details.UrlPath); var urlPath = form.Start.GetAttributeValue("action", Details.UrlPath);
var inputs = form.Children var inputs = form.Children
.SelectMany(elt => elt.DescendantsAndSelf("input")) .SelectMany(elt => elt.DescendantsAndSelf("input"))
.Where(node => !((node.GetAttributeValue("type", "") == "radio" || node.GetAttributeValue("type", "") == "checkbox") && node.GetAttributeValue("checked", "") != "checked"))
.GroupBy(elt => elt.GetAttributeValue("name", elt.GetAttributeValue("id", "")), elt => elt.GetAttributeValue("value", "")) .GroupBy(elt => elt.GetAttributeValue("name", elt.GetAttributeValue("id", "")), elt => elt.GetAttributeValue("value", ""))
.ToDictionary(elt => elt.Key, elt => (IEnumerable<string>)elt); .ToDictionary(elt => elt.Key, elt => (IEnumerable<string>)elt);

View File

@@ -1,18 +1,21 @@
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/). // This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.2.0.0 // SpecFlow Version:1.3.0.0
// Runtime Version:2.0.50727.4927 // Runtime Version:2.0.50727.4927
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
// </auto-generated> // </auto-generated>
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
#region Designer generated code
namespace Orchard.Specs namespace Orchard.Specs
{ {
using TechTalk.SpecFlow; using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.0.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Multiple tenant management")] [NUnit.Framework.DescriptionAttribute("Multiple tenant management")]
public partial class MultipleTenantManagementFeature public partial class MultipleTenantManagementFeature
@@ -58,17 +61,17 @@ namespace Orchard.Specs
#line 6 #line 6
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 7 #line 7
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 8 #line 8
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 9 #line 9
testRunner.When("I go to \"Admin/MultiTenancy\""); testRunner.When("I go to \"Admin/MultiTenancy\"");
#line 10 #line 10
testRunner.Then("I should see \"List of Site\'s Tenants\""); testRunner.Then("I should see \"List of Site\'s Tenants\"");
#line 11 #line 11
testRunner.And("I should see \"<span class=\"tenantName\">Default</span>\""); testRunner.And("I should see \"<span class=\"tenantName\">Default</span>\"");
#line 12 #line 12
testRunner.And("the status should be 200 OK"); testRunner.And("the status should be 200 OK");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -81,15 +84,15 @@ this.ScenarioSetup(scenarioInfo);
#line 14 #line 14
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 15 #line 15
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 16 #line 16
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 17 #line 17
testRunner.When("I go to \"Admin/MultiTenancy/Add\""); testRunner.When("I go to \"Admin/MultiTenancy/Add\"");
#line 18 #line 18
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 19 #line 19
testRunner.Then("I should see \"is required\""); testRunner.Then("I should see \"is required\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -102,11 +105,11 @@ this.ScenarioSetup(scenarioInfo);
#line 21 #line 21
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 22 #line 22
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 23 #line 23
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 24 #line 24
testRunner.When("I go to \"Admin/MultiTenancy/Add\""); testRunner.When("I go to \"Admin/MultiTenancy/Add\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
@@ -115,15 +118,15 @@ this.ScenarioSetup(scenarioInfo);
"Name", "Name",
"Scott"}); "Scott"});
#line 25 #line 25
testRunner.And("I fill in", ((string)(null)), table1); testRunner.And("I fill in", ((string)(null)), table1);
#line 28 #line 28
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 29 #line 29
testRunner.And("I am redirected"); testRunner.And("I am redirected");
#line 30 #line 30
testRunner.Then("I should see \"<span class=\"tenantName\">Scott</span>\""); testRunner.Then("I should see \"<span class=\"tenantName\">Scott</span>\"");
#line 31 #line 31
testRunner.And("the status should be 200 OK"); testRunner.And("the status should be 200 OK");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -136,11 +139,11 @@ this.ScenarioSetup(scenarioInfo);
#line 33 #line 33
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 34 #line 34
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 35 #line 35
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 36 #line 36
testRunner.When("I go to \"Admin/MultiTenancy/Add\""); testRunner.When("I go to \"Admin/MultiTenancy/Add\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
@@ -149,15 +152,15 @@ this.ScenarioSetup(scenarioInfo);
"Name", "Name",
"Scott"}); "Scott"});
#line 37 #line 37
testRunner.And("I fill in", ((string)(null)), table2); testRunner.And("I fill in", ((string)(null)), table2);
#line 40 #line 40
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 41 #line 41
testRunner.And("I am redirected"); testRunner.And("I am redirected");
#line 42 #line 42
testRunner.Then("I should see \"<li class=\"tenant Uninitialized\">\""); testRunner.Then("I should see \"<li class=\"tenant Uninitialized\">\"");
#line 43 #line 43
testRunner.And("the status should be 200 OK"); testRunner.And("the status should be 200 OK");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -170,11 +173,11 @@ this.ScenarioSetup(scenarioInfo);
#line 45 #line 45
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 46 #line 46
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 47 #line 47
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 48 #line 48
testRunner.When("I go to \"Admin/MultiTenancy/Add\""); testRunner.When("I go to \"Admin/MultiTenancy/Add\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
@@ -186,17 +189,17 @@ this.ScenarioSetup(scenarioInfo);
"RequestUrlHost", "RequestUrlHost",
"scott.example.org"}); "scott.example.org"});
#line 49 #line 49
testRunner.And("I fill in", ((string)(null)), table3); testRunner.And("I fill in", ((string)(null)), table3);
#line 53 #line 53
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 54 #line 54
testRunner.And("I go to \"/Setup\" on host scott.example.org"); testRunner.And("I go to \"/Setup\" on host scott.example.org");
#line 55 #line 55
testRunner.Then("I should see \"Welcome to Orchard\""); testRunner.Then("I should see \"Welcome to Orchard\"");
#line 56 #line 56
testRunner.And("I should see \"Finish Setup\""); testRunner.And("I should see \"Finish Setup\"");
#line 57 #line 57
testRunner.And("the status should be 200 OK"); testRunner.And("the status should be 200 OK");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -209,11 +212,11 @@ this.ScenarioSetup(scenarioInfo);
#line 59 #line 59
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 60 #line 60
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 61 #line 61
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 62 #line 62
testRunner.When("I go to \"Admin/MultiTenancy/Add\""); testRunner.When("I go to \"Admin/MultiTenancy/Add\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
@@ -228,21 +231,21 @@ this.ScenarioSetup(scenarioInfo);
"DataProvider", "DataProvider",
"SQLite"}); "SQLite"});
#line 63 #line 63
testRunner.And("I fill in", ((string)(null)), table4); testRunner.And("I fill in", ((string)(null)), table4);
#line 68 #line 68
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 69 #line 69
testRunner.And("I am redirected"); testRunner.And("I am redirected");
#line 70 #line 70
testRunner.And("I go to \"/Setup\" on host scott.example.org"); testRunner.And("I go to \"/Setup\" on host scott.example.org");
#line 71 #line 71
testRunner.Then("I should see \"Welcome to Orchard\""); testRunner.Then("I should see \"Welcome to Orchard\"");
#line 72 #line 72
testRunner.And("I should see \"Finish Setup\""); testRunner.And("I should see \"Finish Setup\"");
#line 73 #line 73
testRunner.And("I should not see \"SQLite\""); testRunner.And("I should not see \"SQLite\"");
#line 74 #line 74
testRunner.And("the status should be 200 OK"); testRunner.And("the status should be 200 OK");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -255,11 +258,11 @@ this.ScenarioSetup(scenarioInfo);
#line 76 #line 76
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 77 #line 77
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 78 #line 78
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 79 #line 79
testRunner.When("I go to \"Admin/MultiTenancy/Add\""); testRunner.When("I go to \"Admin/MultiTenancy/Add\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
@@ -271,11 +274,11 @@ this.ScenarioSetup(scenarioInfo);
"RequestUrlHost", "RequestUrlHost",
"scott.example.org"}); "scott.example.org"});
#line 80 #line 80
testRunner.And("I fill in", ((string)(null)), table5); testRunner.And("I fill in", ((string)(null)), table5);
#line 84 #line 84
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 85 #line 85
testRunner.And("I go to \"/Setup\" on host scott.example.org"); testRunner.And("I go to \"/Setup\" on host scott.example.org");
#line hidden #line hidden
TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
@@ -287,15 +290,15 @@ this.ScenarioSetup(scenarioInfo);
"AdminPassword", "AdminPassword",
"6655321"}); "6655321"});
#line 86 #line 86
testRunner.And("I fill in", ((string)(null)), table6); testRunner.And("I fill in", ((string)(null)), table6);
#line 90 #line 90
testRunner.And("I hit \"Finish Setup\""); testRunner.And("I hit \"Finish Setup\"");
#line 91 #line 91
testRunner.And("I go to \"/Default.aspx\""); testRunner.And("I go to \"/Default.aspx\"");
#line 92 #line 92
testRunner.Then("I should see \"<h1>Scott Site</h1>\""); testRunner.Then("I should see \"<h1>Scott Site</h1>\"");
#line 93 #line 93
testRunner.And("I should see \"Welcome, <strong>admin</strong>!\""); testRunner.And("I should see \"Welcome, <strong>admin</strong>!\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -308,19 +311,20 @@ this.ScenarioSetup(scenarioInfo);
#line 95 #line 95
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 96 #line 96
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 97 #line 97
testRunner.And("I have installed \"Orchard.MultiTenancy\""); testRunner.And("I have installed \"Orchard.MultiTenancy\"");
#line 98 #line 98
testRunner.And("I have tenant \"Alpha\" on \"example.org\" as \"New-site-name\""); testRunner.And("I have tenant \"Alpha\" on \"example.org\" as \"New-site-name\"");
#line 99 #line 99
testRunner.When("I execute >tenant list"); testRunner.When("I execute >tenant list");
#line 100 #line 100
testRunner.Then("I should see \"Name: Alpha\""); testRunner.Then("I should see \"Name: Alpha\"");
#line 101 #line 101
testRunner.And("I should see \"Request Url Host: example.org\""); testRunner.And("I should see \"Request Url Host: example.org\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
} }
} }
#endregion