--HG--
branch : net40
This commit is contained in:
Renaud Paquay
2010-05-21 21:53:00 -07:00
271 changed files with 11089 additions and 7795 deletions

View File

@@ -40,7 +40,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View File

@@ -5,6 +5,7 @@ using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using NUnit.Framework;
using TechTalk.SpecFlow;
namespace Orchard.Profile.Tests {
@@ -17,7 +18,18 @@ namespace Orchard.Profile.Tests {
[Given(@"I am logged in")]
public void GivenIAmLoggedIn() {
DoRequest("/Users/Account/LogOn", "userNameOrEmail=admin&password=profiling-secret&rememberMe=false");
DoRequest("/Users/Account/LogOn");
const string requestVerificationTokenName = "__RequestVerificationToken";
const string valueMarker = "value=\"";
var tokenIndex = _text.IndexOf(requestVerificationTokenName);
var valueIndex = _text.IndexOf(valueMarker, tokenIndex);
var valueStart = valueIndex + valueMarker.Length;
var valueEnd = _text.IndexOf("\"", valueStart);
var requestVerificationTokenValue = _text.Substring(valueStart, valueEnd - valueStart);
DoRequest("/Users/Account/LogOn", "userNameOrEmail=admin&password=profiling-secret&rememberMe=false&" + requestVerificationTokenName + "=" + requestVerificationTokenValue);
}
[When(@"I go to ""(.*)""")]

View File

@@ -3,6 +3,24 @@
As a developer
I want to generate a fixed number of repeatable requests
Scenario: Warmup
Given I am logged in
When I go to "/admin"
When I go to "/blog0"
When I go to "/"
Scenario: Dashboard
Given I am logged in
When I go to "/admin" 40 times
Scenario: Hitting blogs
Given I am logged in
When I go to "/blog0" 10 times
When I go to "/blog1" 10 times
When I go to "/blog2" 10 times
When I go to "/blog3" 10 times
When I go to "/blog4" 10 times
Scenario: Hitting home page
Given I am logged in
When I go to "/" 40 times

View File

@@ -51,16 +51,73 @@ namespace Orchard.Profile.Tests
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Dashboard")]
public virtual void Dashboard()
[NUnit.Framework.DescriptionAttribute("Warmup")]
public virtual void Warmup()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dashboard", ((string[])(null)));
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Warmup", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
testRunner.Given("I am logged in");
#line 8
testRunner.When("I go to \"/admin\"");
#line 9
testRunner.When("I go to \"/blog0\"");
#line 10
testRunner.When("I go to \"/\"");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Dashboard")]
public virtual void Dashboard()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dashboard", ((string[])(null)));
#line 12
this.ScenarioSetup(scenarioInfo);
#line 13
testRunner.Given("I am logged in");
#line 14
testRunner.When("I go to \"/admin\" 40 times");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Hitting blogs")]
public virtual void HittingBlogs()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting blogs", ((string[])(null)));
#line 16
this.ScenarioSetup(scenarioInfo);
#line 17
testRunner.Given("I am logged in");
#line 18
testRunner.When("I go to \"/blog0\" 10 times");
#line 19
testRunner.When("I go to \"/blog1\" 10 times");
#line 20
testRunner.When("I go to \"/blog2\" 10 times");
#line 21
testRunner.When("I go to \"/blog3\" 10 times");
#line 22
testRunner.When("I go to \"/blog4\" 10 times");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Hitting home page")]
public virtual void HittingHomePage()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting home page", ((string[])(null)));
#line 24
this.ScenarioSetup(scenarioInfo);
#line 25
testRunner.Given("I am logged in");
#line 26
testRunner.When("I go to \"/\" 40 times");
#line hidden
testRunner.CollectScenarioErrors();
}

View File

@@ -1,6 +1,3 @@
help commands
setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SQLite /EnabledFeatures:Orchard.Framework,Common,Dashboard,Feeds,HomePage,Navigation,Scheduling,Settings,XmlRpc,Orchard.Users,Orchard.Roles,TinyMce,Orchard.Modules,Orchard.Themes,Orchard.MultiTenancy,Orchard.Pages,Orchard.Blogs,Orchard.Comments,Futures.Widgets,Orchard.Media,Orchard.Tags,Orchard.DevTools
help commands
tenant list
feature list
setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SQLite /EnabledFeatures:Orchard.Framework,Common,Dashboard,Feeds,HomePage,Navigation,Scheduling,Settings,XmlRpc,Orchard.Users,Orchard.Roles,TinyMce,Orchard.Modules,Orchard.Themes,Orchard.MultiTenancy,Orchard.Pages,Orchard.Blogs,Orchard.Comments,Futures.Widgets,Orchard.Media,Orchard.Tags,Orchard.DevTools
add profiling data
feature disable Orchard.DevTools