Core.Strings - refactor + new IShortStringHelper

This commit is contained in:
Stephan
2013-02-07 13:30:50 -01:00
parent dced287c1c
commit a0f662c114
18 changed files with 5920 additions and 167 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Security;
using System.Text;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Strings;
using Umbraco.Core.ObjectResolution;
namespace Umbraco.Tests.CoreStrings
{
[TestFixture]
public class ShortStringHelperResolverTest
{
[SetUp]
public void Setup()
{
ShortStringHelperResolver.Reset();
}
[TearDown]
public void TearDown()
{
ShortStringHelperResolver.Reset();
}
[Test]
public void FreezesHelperWhenResolutionFreezes()
{
var helper = new MockShortStringHelper();
ShortStringHelperResolver.Current = new ShortStringHelperResolver(helper);
Assert.IsFalse(helper.IsFrozen);
Resolution.Freeze();
Assert.AreSame(helper, ShortStringHelperResolver.Current.Helper);
Assert.IsTrue(helper.IsFrozen);
}
}
}