mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixing RunningShellTable tests
--HG-- branch : 1.x
This commit is contained in:
@@ -112,7 +112,7 @@ namespace Orchard.Tests.Environment {
|
|||||||
public void PathAlsoCausesMatch() {
|
public void PathAlsoCausesMatch() {
|
||||||
var table = (IRunningShellTable)new RunningShellTable();
|
var table = (IRunningShellTable)new RunningShellTable();
|
||||||
var settings = new ShellSettings { Name = ShellSettings.DefaultName };
|
var settings = new ShellSettings { Name = ShellSettings.DefaultName };
|
||||||
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "~/foo" };
|
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "foo" };
|
||||||
table.Add(settings);
|
table.Add(settings);
|
||||||
table.Add(settingsA);
|
table.Add(settingsA);
|
||||||
var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com"));
|
var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com"));
|
||||||
@@ -123,10 +123,10 @@ namespace Orchard.Tests.Environment {
|
|||||||
public void PathAndHostMustBothMatch() {
|
public void PathAndHostMustBothMatch() {
|
||||||
var table = (IRunningShellTable)new RunningShellTable();
|
var table = (IRunningShellTable)new RunningShellTable();
|
||||||
var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com", };
|
var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com", };
|
||||||
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "~/foo" };
|
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "foo" };
|
||||||
var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "~/bar" };
|
var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "bar" };
|
||||||
var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" };
|
var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" };
|
||||||
var settingsD = new ShellSettings { Name = "Delta", RequestUrlPrefix = "~/Quux" };
|
var settingsD = new ShellSettings { Name = "Delta", RequestUrlPrefix = "Quux" };
|
||||||
table.Add(settings);
|
table.Add(settings);
|
||||||
table.Add(settingsA);
|
table.Add(settingsA);
|
||||||
table.Add(settingsB);
|
table.Add(settingsB);
|
||||||
@@ -152,7 +152,7 @@ namespace Orchard.Tests.Environment {
|
|||||||
[Test]
|
[Test]
|
||||||
public void PathAloneWillMatch() {
|
public void PathAloneWillMatch() {
|
||||||
var table = (IRunningShellTable)new RunningShellTable();
|
var table = (IRunningShellTable)new RunningShellTable();
|
||||||
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "~/foo" };
|
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "foo" };
|
||||||
table.Add(settingsA);
|
table.Add(settingsA);
|
||||||
|
|
||||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer()));
|
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer()));
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<label for="@Html.FieldIdFor(m => m.RequestUrlPrefix)">@T("URL prefix")</label>
|
<label for="@Html.FieldIdFor(m => m.RequestUrlPrefix)">@T("URL prefix")</label>
|
||||||
@Html.TextBoxFor(m => m.RequestUrlPrefix, new { @class = "textMedium" })
|
@Html.TextBoxFor(m => m.RequestUrlPrefix, new { @class = "textMedium" })
|
||||||
<span class="hint">@T("Example: If prefix is \"site1\", the tenant URL prefix is \"http://orchardproject.net/site1\"")</span>
|
<span class="hint">@T("(Optional) Example: If prefix is \"site1\", the tenant URL prefix is \"http://orchardproject.net/site1\"")</span>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<label for="@Html.FieldIdFor(m => m.RequestUrlPrefix)">@T("URL prefix")</label>
|
<label for="@Html.FieldIdFor(m => m.RequestUrlPrefix)">@T("URL prefix")</label>
|
||||||
@Html.TextBoxFor(m => m.RequestUrlPrefix, new { @class = "textMedium" })
|
@Html.TextBoxFor(m => m.RequestUrlPrefix, new { @class = "textMedium" })
|
||||||
<span class="hint">@T("Example: If prefix is \"site1\", the tenant URL prefix is \"http://orchardproject.net/site1\"")</span>
|
<span class="hint">@T("(Optional) Example: If prefix is \"site1\", the tenant URL prefix is \"http://orchardproject.net/site1\"")</span>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user