diff --git a/STPTests/STPTests.csproj b/STPTests/STPTests.csproj
index da184f3..feed401 100644
--- a/STPTests/STPTests.csproj
+++ b/STPTests/STPTests.csproj
@@ -111,6 +111,7 @@
Code
+
diff --git a/STPTests/TestThreadApartmentState.cs b/STPTests/TestThreadApartmentState.cs
index ea6d4f3..9e43a45 100644
--- a/STPTests/TestThreadApartmentState.cs
+++ b/STPTests/TestThreadApartmentState.cs
@@ -5,7 +5,7 @@ using Amib.Threading;
namespace SmartThreadPoolTests
{
///
- /// Summary description for TestThreadPriority.
+ /// Summary description for TestThreadApartment.
///
[TestFixture]
[Category("TestThreadApartment")]
@@ -26,7 +26,7 @@ namespace SmartThreadPoolTests
private static void CheckApartmentState(ApartmentState requestApartmentState)
{
STPStartInfo stpStartInfo = new STPStartInfo();
- stpStartInfo.ApartmentState = requestApartmentState;
+ stpStartInfo.ApartmentState = requestApartmentState;
SmartThreadPool stp = new SmartThreadPool(stpStartInfo);
diff --git a/STPTests/TestThreadIsBackground.cs b/STPTests/TestThreadIsBackground.cs
new file mode 100644
index 0000000..1383725
--- /dev/null
+++ b/STPTests/TestThreadIsBackground.cs
@@ -0,0 +1,47 @@
+using System.Threading;
+using NUnit.Framework;
+using Amib.Threading;
+
+namespace SmartThreadPoolTests
+{
+ ///
+ /// Summary description for TestThreadIsBackground.
+ ///
+ [TestFixture]
+ [Category("TestThreadIsBackground")]
+ public class TestThreadIsBackground
+ {
+ [Test]
+ public void TestIsBackground()
+ {
+ CheckIsBackground(true);
+ }
+
+ [Test]
+ public void TestNotIsBackground()
+ {
+ CheckIsBackground(false);
+ }
+
+ private static void CheckIsBackground(bool isBackground)
+ {
+ STPStartInfo stpStartInfo = new STPStartInfo();
+ stpStartInfo.AreThreadsBackground = isBackground;
+
+ SmartThreadPool stp = new SmartThreadPool(stpStartInfo);
+
+ IWorkItemResult wir = stp.QueueWorkItem(() => GetCurrentThreadIsBackground());
+
+ bool resultIsBackground = wir.GetResult();
+
+ stp.WaitForIdle();
+
+ Assert.AreEqual(isBackground, resultIsBackground);
+ }
+
+ private static bool GetCurrentThreadIsBackground()
+ {
+ return Thread.CurrentThread.IsBackground;
+ }
+ }
+}
\ No newline at end of file
diff --git a/SmartThreadPool/SmartThreadPool.cs b/SmartThreadPool/SmartThreadPool.cs
index 65dc701..d512137 100644
--- a/SmartThreadPool/SmartThreadPool.cs
+++ b/SmartThreadPool/SmartThreadPool.cs
@@ -89,7 +89,6 @@
// - Added IsBackground option to threads
// - Added ApartmentState to threads
// - Fixed thread creation when queuing many work items at the same time.
-
#endregion
using System;