mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Adding SpecFlow test for dynamic compilation
--HG-- branch : dev
This commit is contained in:
@@ -19,6 +19,7 @@ namespace Orchard.Specs.Bindings {
|
||||
private HtmlDocument _doc;
|
||||
private MessageSink _messages;
|
||||
private static readonly Path _orchardTemp = Path.Get(System.IO.Path.GetTempPath()).Combine("Orchard.Specs");
|
||||
private ExtensionDeploymentOptions _moduleDeploymentOptions = ExtensionDeploymentOptions.CompiledAssembly;
|
||||
|
||||
public WebHost Host {
|
||||
get { return _webHost; }
|
||||
@@ -63,6 +64,10 @@ namespace Orchard.Specs.Bindings {
|
||||
GivenIHaveACleanSiteBasedOn("Orchard.Web");
|
||||
}
|
||||
|
||||
[Given(@"I have chosen to deploy modules as source files only")]
|
||||
public void GivenIHaveChosenToDeployModulesAsSourceFilesOnly() {
|
||||
_moduleDeploymentOptions = ExtensionDeploymentOptions.SourceCode;
|
||||
}
|
||||
|
||||
[Given(@"I have a clean site based on (.*)")]
|
||||
public void GivenIHaveACleanSiteBasedOn(string siteFolder) {
|
||||
@@ -105,7 +110,7 @@ namespace Orchard.Specs.Bindings {
|
||||
|
||||
[Given(@"I have module ""(.*)""")]
|
||||
public void GivenIHaveModule(string moduleName) {
|
||||
Host.CopyExtension("Modules", moduleName, ExtensionDeploymentOptions.CompiledAssembly);
|
||||
Host.CopyExtension("Modules", moduleName, _moduleDeploymentOptions);
|
||||
}
|
||||
|
||||
[Given(@"I have theme ""(.*)""")]
|
||||
|
@@ -142,6 +142,12 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Hosting\ExtensionDeploymentOptions.cs" />
|
||||
<Compile Include="SiteCompilation.feature.cs">
|
||||
<DependentUpon>SiteCompilation.feature</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Hosting\MessageSink.cs" />
|
||||
<Compile Include="Hosting\HostingTraceListener.cs" />
|
||||
<Compile Include="Hosting\TraceEnabledDataServicesProviderFactory.cs" />
|
||||
@@ -222,6 +228,10 @@
|
||||
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||
<LastGenOutput>ContentRights.feature.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="SiteCompilation.feature">
|
||||
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||
<LastGenOutput>SiteCompilation.feature.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Hosting\Orchard.Web\Config\Diagnostics.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
10
src/Orchard.Specs/SiteCompilation.feature
Normal file
10
src/Orchard.Specs/SiteCompilation.feature
Normal file
@@ -0,0 +1,10 @@
|
||||
Feature: The compilation of modules installed in a site
|
||||
In order to install on Orchard site
|
||||
As a privileged user
|
||||
I want to have the modules compiled/installed properly
|
||||
|
||||
Scenario: Dynamic compilation support: modules can be deployed as source files only
|
||||
Given I have chosen to deploy modules as source files only
|
||||
And I have installed Orchard
|
||||
When I go to "admin"
|
||||
Then I should see "<div id="orchard-version">Orchard v(?:\.\d+){2,4}</div>"
|
76
src/Orchard.Specs/SiteCompilation.feature.cs
generated
Normal file
76
src/Orchard.Specs/SiteCompilation.feature.cs
generated
Normal file
@@ -0,0 +1,76 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:1.3.2.0
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
// ------------------------------------------------------------------------------
|
||||
#region Designer generated code
|
||||
namespace Orchard.Specs
|
||||
{
|
||||
using TechTalk.SpecFlow;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.2.0")]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[NUnit.Framework.TestFixtureAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("The compilation of modules installed in a site")]
|
||||
public partial class TheCompilationOfModulesInstalledInASiteFeature
|
||||
{
|
||||
|
||||
private static TechTalk.SpecFlow.ITestRunner testRunner;
|
||||
|
||||
#line 1 "SiteCompilation.feature"
|
||||
#line hidden
|
||||
|
||||
[NUnit.Framework.TestFixtureSetUpAttribute()]
|
||||
public virtual void FeatureSetup()
|
||||
{
|
||||
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
|
||||
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "The compilation of modules installed in a site", "In order to install on Orchard site\r\nAs a privileged user\r\nI want to have the mod" +
|
||||
"ules compiled/installed properly", ((string[])(null)));
|
||||
testRunner.OnFeatureStart(featureInfo);
|
||||
}
|
||||
|
||||
[NUnit.Framework.TestFixtureTearDownAttribute()]
|
||||
public virtual void FeatureTearDown()
|
||||
{
|
||||
testRunner.OnFeatureEnd();
|
||||
testRunner = null;
|
||||
}
|
||||
|
||||
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
|
||||
{
|
||||
testRunner.OnScenarioStart(scenarioInfo);
|
||||
}
|
||||
|
||||
[NUnit.Framework.TearDownAttribute()]
|
||||
public virtual void ScenarioTearDown()
|
||||
{
|
||||
testRunner.OnScenarioEnd();
|
||||
}
|
||||
|
||||
[NUnit.Framework.TestAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Dynamic compilation support: modules can be deployed as source files only")]
|
||||
public virtual void DynamicCompilationSupportModulesCanBeDeployedAsSourceFilesOnly()
|
||||
{
|
||||
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dynamic compilation support: modules can be deployed as source files only", ((string[])(null)));
|
||||
#line 6
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 7
|
||||
testRunner.Given("I have chosen to deploy modules as source files only");
|
||||
#line 8
|
||||
testRunner.And("I have installed Orchard");
|
||||
#line 9
|
||||
testRunner.When("I go to \"admin\"");
|
||||
#line 10
|
||||
testRunner.Then("I should see \"<div id=\"orchard-version\">Orchard v(?:\\.\\d+){2,4}</div>\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
Reference in New Issue
Block a user