Moving cms pages into centralized test project. Adding a NullLocalalizer.Instance for initializing Localizer T properties in constructor.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4040309
This commit is contained in:
loudej
2009-11-14 05:35:58 +00:00
parent a49384ca0f
commit 6d2e8c0983
18 changed files with 1298 additions and 10 deletions

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Orchard.Localization;
namespace Orchard.Tests.Localization {
[TestFixture]
public class NullLocalizerTests {
[Test]
public void StringsShouldPassThrough() {
var result = NullLocalizer.Instance("hello world");
Assert.That(result.ToString(), Is.EqualTo("hello world"));
}
[Test]
public void StringsShouldFormatIfArgumentsArePassedIn() {
var result = NullLocalizer.Instance("hello {0} world", "!");
Assert.That(result.ToString(), Is.EqualTo("hello ! world"));
}
[Test]
public void StringsShouldNotFormatWithoutAnyArguments() {
var result = NullLocalizer.Instance("hello {0} world");
Assert.That(result.ToString(), Is.EqualTo("hello {0} world"));
}
}
}

View File

@@ -103,6 +103,7 @@
<Compile Include="Environment\DefaultOrchardHostTests.cs" />
<Compile Include="Environment\DefaultOrchardShellTests.cs" />
<Compile Include="Environment\OrchardStarterTests.cs" />
<Compile Include="Localization\NullLocalizerTests.cs" />
<Compile Include="Logging\LoggingModuleTests.cs" />
<Compile Include="Models\DefaultModelBuilderTests.cs" />
<Compile Include="Models\Stubs\Alpha.cs" />