mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-24 08:46:48 +08:00
144 lines
6.1 KiB
C#
144 lines
6.1 KiB
C#
// ------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by SpecFlow (http://www.specflow.org/).
|
|
// SpecFlow Version:2.4.0.0
|
|
// SpecFlow Generator Version:2.4.0.0
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
// ------------------------------------------------------------------------------
|
|
#region Designer generated code
|
|
#pragma warning disable
|
|
namespace Orchard.Specs
|
|
{
|
|
using TechTalk.SpecFlow;
|
|
|
|
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "2.4.0.0")]
|
|
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
[NUnit.Framework.TestFixtureAttribute()]
|
|
[NUnit.Framework.DescriptionAttribute("Addition")]
|
|
public partial class AdditionFeature
|
|
{
|
|
|
|
private TechTalk.SpecFlow.ITestRunner testRunner;
|
|
|
|
#line 1 "PermissionModel.feature"
|
|
#line hidden
|
|
|
|
[NUnit.Framework.OneTimeSetUpAttribute()]
|
|
public virtual void FeatureSetup()
|
|
{
|
|
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
|
|
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Addition", " In order to prevent security model regressions\r\n As a user with specific p" +
|
|
"ermissions\r\n I should to be granted or denied access to various actions", ProgrammingLanguage.CSharp, ((string[])(null)));
|
|
testRunner.OnFeatureStart(featureInfo);
|
|
}
|
|
|
|
[NUnit.Framework.OneTimeTearDownAttribute()]
|
|
public virtual void FeatureTearDown()
|
|
{
|
|
testRunner.OnFeatureEnd();
|
|
testRunner = null;
|
|
}
|
|
|
|
[NUnit.Framework.SetUpAttribute()]
|
|
public virtual void TestInitialize()
|
|
{
|
|
}
|
|
|
|
[NUnit.Framework.TearDownAttribute()]
|
|
public virtual void ScenarioTearDown()
|
|
{
|
|
testRunner.OnScenarioEnd();
|
|
}
|
|
|
|
public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
|
|
{
|
|
testRunner.OnScenarioInitialize(scenarioInfo);
|
|
testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs<NUnit.Framework.TestContext>(NUnit.Framework.TestContext.CurrentContext);
|
|
}
|
|
|
|
public virtual void ScenarioStart()
|
|
{
|
|
testRunner.OnScenarioStart();
|
|
}
|
|
|
|
public virtual void ScenarioCleanup()
|
|
{
|
|
testRunner.CollectScenarioErrors();
|
|
}
|
|
|
|
[NUnit.Framework.TestAttribute()]
|
|
[NUnit.Framework.DescriptionAttribute("Login can be automated")]
|
|
[NUnit.Framework.CategoryAttribute("security")]
|
|
public virtual void LoginCanBeAutomated()
|
|
{
|
|
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Login can be automated", null, new string[] {
|
|
"security"});
|
|
#line 7
|
|
this.ScenarioInitialize(scenarioInfo);
|
|
this.ScenarioStart();
|
|
#line 8
|
|
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
|
|
#line 9
|
|
testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line 10
|
|
testRunner.When("I go to \"users/account/logoff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
|
#line 11
|
|
testRunner.And("I go to \"users/account/logon\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line hidden
|
|
TechTalk.SpecFlow.Table table144 = new TechTalk.SpecFlow.Table(new string[] {
|
|
"name",
|
|
"value"});
|
|
table144.AddRow(new string[] {
|
|
"userNameOrEmail",
|
|
"bob"});
|
|
table144.AddRow(new string[] {
|
|
"password",
|
|
"qwerty123!"});
|
|
#line 12
|
|
testRunner.And("I fill in", ((string)(null)), table144, "And ");
|
|
#line 16
|
|
testRunner.And("I hit \"Sign In\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line 17
|
|
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line 18
|
|
testRunner.Then("I should see \"Welcome\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
|
#line 19
|
|
testRunner.And("I should see \"bob\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line hidden
|
|
this.ScenarioCleanup();
|
|
}
|
|
|
|
[NUnit.Framework.TestAttribute()]
|
|
[NUnit.Framework.DescriptionAttribute("Anonymous user can see the home page but not the dashboard")]
|
|
[NUnit.Framework.CategoryAttribute("security")]
|
|
public virtual void AnonymousUserCanSeeTheHomePageButNotTheDashboard()
|
|
{
|
|
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Anonymous user can see the home page but not the dashboard", null, new string[] {
|
|
"security"});
|
|
#line 22
|
|
this.ScenarioInitialize(scenarioInfo);
|
|
this.ScenarioStart();
|
|
#line 23
|
|
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
|
|
#line 24
|
|
testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line 25
|
|
testRunner.When("I sign in as \"bob\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
|
#line 26
|
|
testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line 27
|
|
testRunner.Then("I should see \"this is the homepage of your new site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
|
#line 28
|
|
testRunner.And("I should be denied access when I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
|
#line hidden
|
|
this.ScenarioCleanup();
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore
|
|
#endregion
|