Core.ObjectsResolution - add unit tests, fix some bugs

This commit is contained in:
Stephan
2013-01-23 09:41:01 -01:00
parent 73df3ec0de
commit 6146a0576c
25 changed files with 893 additions and 208 deletions

View File

@@ -28,7 +28,7 @@ namespace Umbraco.Core.ObjectResolution
public static void EnsureIsFrozen()
{
if (!IsFrozen)
throw new Exception("Resolution is not frozen, it is not yet possible to get values from it.");
throw new InvalidOperationException("Resolution is not frozen, it is not yet possible to get values from it.");
}
/// <summary>
@@ -62,14 +62,15 @@ namespace Umbraco.Core.ObjectResolution
if (Frozen != null)
Frozen(null, null);
}
/// <summary>
/// Unfreezes resolution.
/// </summary>
/// <remarks>To be used in unit tests.</remarks>
internal static void Unfreeze()
{
IsFrozen = false;
}
/// <summary>
/// Resets resolution, ie unfreezes it and clears Frozen event.
/// </summary>
/// <remarks>To be used in unit tests.</remarks>
internal static void Reset()
{
IsFrozen = false;
Frozen = null;
}
}
}