mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
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:
29
src/Orchard.Tests/Localization/NullLocalizerTests.cs
Normal file
29
src/Orchard.Tests/Localization/NullLocalizerTests.cs
Normal 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"));
|
||||
}
|
||||
}
|
||||
}
|
@@ -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" />
|
||||
|
Reference in New Issue
Block a user