diff --git a/src/Umbraco.Tests/TestHelpers/Settable.cs b/src/Umbraco.Core/Settable.cs
similarity index 97%
rename from src/Umbraco.Tests/TestHelpers/Settable.cs
rename to src/Umbraco.Core/Settable.cs
index 71c697f660..ba46543d4d 100644
--- a/src/Umbraco.Tests/TestHelpers/Settable.cs
+++ b/src/Umbraco.Core/Settable.cs
@@ -1,9 +1,7 @@
using System;
-namespace Umbraco.Tests.TestHelpers
+namespace Umbraco.Core
{
- // fixme - belongs to Core?
-
///
/// Represents a value that can be assigned a value.
///
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index 85d09e3b0c..f7a7fb1b28 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -554,6 +554,7 @@
+
diff --git a/src/Umbraco.Tests/AttemptTests.cs b/src/Umbraco.Tests/CoreThings/AttemptTests.cs
similarity index 86%
rename from src/Umbraco.Tests/AttemptTests.cs
rename to src/Umbraco.Tests/CoreThings/AttemptTests.cs
index 84d33c4351..a004095243 100644
--- a/src/Umbraco.Tests/AttemptTests.cs
+++ b/src/Umbraco.Tests/CoreThings/AttemptTests.cs
@@ -1,25 +1,24 @@
-using System;
-using NUnit.Framework;
-using Umbraco.Core;
-
-namespace Umbraco.Tests
-{
- [TestFixture]
- public class AttemptTests
- {
-
- [Test]
- public void AttemptIf()
- {
- // just making sure that it is ok to use TryParse as a condition
-
- int value;
- var attempt = Attempt.If(int.TryParse("1234", out value), value);
- Assert.IsTrue(attempt.Success);
- Assert.AreEqual(1234, attempt.Result);
-
- attempt = Attempt.If(int.TryParse("12xxx34", out value), value);
- Assert.IsFalse(attempt.Success);
- }
- }
-}
+using NUnit.Framework;
+using Umbraco.Core;
+
+namespace Umbraco.Tests.CoreThings
+{
+ [TestFixture]
+ public class AttemptTests
+ {
+
+ [Test]
+ public void AttemptIf()
+ {
+ // just making sure that it is ok to use TryParse as a condition
+
+ int value;
+ var attempt = Attempt.If(int.TryParse("1234", out value), value);
+ Assert.IsTrue(attempt.Success);
+ Assert.AreEqual(1234, attempt.Result);
+
+ attempt = Attempt.If(int.TryParse("12xxx34", out value), value);
+ Assert.IsFalse(attempt.Success);
+ }
+ }
+}
diff --git a/src/Umbraco.Tests/CallContextTests.cs b/src/Umbraco.Tests/CoreThings/CallContextTests.cs
similarity index 92%
rename from src/Umbraco.Tests/CallContextTests.cs
rename to src/Umbraco.Tests/CoreThings/CallContextTests.cs
index 0c2c6dd203..6e9aeb2ba9 100644
--- a/src/Umbraco.Tests/CallContextTests.cs
+++ b/src/Umbraco.Tests/CoreThings/CallContextTests.cs
@@ -2,7 +2,7 @@
using NUnit.Framework;
using Umbraco.Core;
-namespace Umbraco.Tests
+namespace Umbraco.Tests.CoreThings
{
[TestFixture]
public class CallContextTests
@@ -35,11 +35,11 @@ namespace Umbraco.Tests
SafeCallContext.Clear();
}
- //[TearDown]
- //public void TearDown()
- //{
- // SafeCallContext.Clear();
- //}
+ [TearDown]
+ public void TearDown()
+ {
+ SafeCallContext.Clear();
+ }
[Test]
public void Test1()
diff --git a/src/Umbraco.Tests/DelegateExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/DelegateExtensionsTests.cs
similarity index 76%
rename from src/Umbraco.Tests/DelegateExtensionsTests.cs
rename to src/Umbraco.Tests/CoreThings/DelegateExtensionsTests.cs
index 511440c2c7..d7177f3e5a 100644
--- a/src/Umbraco.Tests/DelegateExtensionsTests.cs
+++ b/src/Umbraco.Tests/CoreThings/DelegateExtensionsTests.cs
@@ -3,16 +3,15 @@ using Lucene.Net.Index;
using NUnit.Framework;
using Umbraco.Core;
-namespace Umbraco.Tests
+namespace Umbraco.Tests.CoreThings
{
[TestFixture]
public class DelegateExtensionsTests
{
-
[Test]
public void Only_Executes_Specific_Count()
{
- var maxTries = 5;
+ const int maxTries = 5;
var totalTries = 0;
DelegateExtensions.RetryUntilSuccessOrMaxAttempts((currentTry) =>
{
@@ -26,21 +25,14 @@ namespace Umbraco.Tests
[Test]
public void Quits_On_Success_Count()
{
- var maxTries = 5;
var totalTries = 0;
DelegateExtensions.RetryUntilSuccessOrMaxAttempts((currentTry) =>
{
totalTries = currentTry;
- if (totalTries == 2)
- {
- return Attempt.Succeed();
- }
- return Attempt.Fail();
+ return totalTries == 2 ? Attempt.Succeed() : Attempt.Fail();
}, 5, TimeSpan.FromMilliseconds(10));
Assert.AreEqual(2, totalTries);
}
-
-
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Tests/EnumerableExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/EnumerableExtensionsTests.cs
similarity index 62%
rename from src/Umbraco.Tests/EnumerableExtensionsTests.cs
rename to src/Umbraco.Tests/CoreThings/EnumerableExtensionsTests.cs
index da69ab9d40..78afae719f 100644
--- a/src/Umbraco.Tests/EnumerableExtensionsTests.cs
+++ b/src/Umbraco.Tests/CoreThings/EnumerableExtensionsTests.cs
@@ -1,196 +1,197 @@
-using System.Collections.Generic;
-using System.Linq;
-using NUnit.Framework;
-using Umbraco.Core;
-using Umbraco.Tests;
-using umbraco.BusinessLogic;
-
-namespace Umbraco.Tests
-{
- [TestFixture]
- public class EnumerableExtensionsTests
- {
-
- [Test]
- public void Unsorted_Sequence_Equal()
- {
- var list1 = new[] { 1, 2, 3, 4, 5, 6 };
- var list2 = new[] { 6, 5, 3, 2, 1, 4 };
- var list3 = new[] { 6, 5, 4, 3, 2, 2 };
-
- Assert.IsTrue(list1.UnsortedSequenceEqual(list2));
- Assert.IsTrue(list2.UnsortedSequenceEqual(list1));
- Assert.IsFalse(list1.UnsortedSequenceEqual(list3));
-
- Assert.IsTrue(((IEnumerable