diff --git a/MultiThreadingStudy.xUnitTest/ThreadTest.cs b/MultiThreadingStudy.xUnitTest/ThreadTest.cs
new file mode 100644
index 0000000..2d786fa
--- /dev/null
+++ b/MultiThreadingStudy.xUnitTest/ThreadTest.cs
@@ -0,0 +1,60 @@
+using Xunit.Abstractions;
+
+namespace MultiThreadingStudy.xUnitTest
+{
+ public class ThreadTest:IDisposable
+ {
+ private readonly ITestOutputHelper _output;
+
+ public ThreadTest(ITestOutputHelper testOutput)
+ {
+ _output = testOutput;
+ }
+
+ ///
+ /// 测试方法的启动线程为后台线程
+ /// 结论:在测试方法中新启动的线程(即使设置成前台线程),默认情况下,不能阻止单元测试方法的执行结束。
+ /// 测试方法很可能先于新启动的线程结束运行,造成新线程没有执行完就随着测试方法线程结束而结束。
+ ///
+ [Fact]
+ public void TestRunThread_Test()
+ {
+ _output.WriteLine($"主线程Id={Thread.CurrentThread.ManagedThreadId}, 是否后台线程={Thread.CurrentThread.IsBackground}");
+
+ //断言:测试的启动线程为后台线程
+ Assert.True( Thread.CurrentThread.IsBackground);
+ }
+
+ ///
+ ///
+ ///
+ [Fact]
+ public void Test1()
+ {
+ _output.WriteLine($"主线程Id={Thread.CurrentThread.ManagedThreadId}, 是否后台线程={Thread.CurrentThread.IsBackground}");
+
+
+ Thread t = new Thread(() =>
+ {
+ _output.WriteLine($"新线程Id={Thread.CurrentThread.ManagedThreadId}, 新线程名称={Thread.CurrentThread.Name}");
+
+ _output.WriteLine($"{Thread.CurrentThread.Name} 新线程,开始休眠");
+ Thread.Sleep(100);
+ _output.WriteLine($"{Thread.CurrentThread.Name} 新线程从休眠中唤醒,执行结束!");
+ })
+ {
+ Name = "FirstThread",
+ Priority = ThreadPriority.Normal,
+ IsBackground = false,
+ };
+
+ t.Start();
+ t.Join();
+ }
+
+ public void Dispose()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MultiThreadingStudy.xUnitTest/UnitTest1.cs b/MultiThreadingStudy.xUnitTest/UnitTest1.cs
deleted file mode 100644
index 22d3b78..0000000
--- a/MultiThreadingStudy.xUnitTest/UnitTest1.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace MultiThreadingStudy.xUnitTest
-{
- public class UnitTest1
- {
- [Fact]
- public void Test1()
- {
-
- }
- }
-}
\ No newline at end of file
diff --git a/MultiThreadingStudy.xUnitTest/UseXunit.cs b/MultiThreadingStudy.xUnitTest/UseXunit.cs
new file mode 100644
index 0000000..79b14b9
--- /dev/null
+++ b/MultiThreadingStudy.xUnitTest/UseXunit.cs
@@ -0,0 +1,25 @@
+using Xunit.Abstractions;
+
+namespace MultiThreadingStudy.xUnitTest
+{
+ public class UseXunit:IDisposable
+ {
+ private readonly ITestOutputHelper _output;
+
+ public UseXunit(ITestOutputHelper testOutput)
+ {
+ _output = testOutput;
+ }
+
+ [Fact]
+ public void Test1()
+ {
+ _output.WriteLine("使用 xUnit 日志");
+ }
+
+ public void Dispose()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MultiThreadingStudy.xUnitTest/Usings.cs b/MultiThreadingStudy.xUnitTest/Usings.cs
index 8c927eb..2dfbf26 100644
--- a/MultiThreadingStudy.xUnitTest/Usings.cs
+++ b/MultiThreadingStudy.xUnitTest/Usings.cs
@@ -1 +1,5 @@
-global using Xunit;
\ No newline at end of file
+global using Xunit;
+
+global using System.Threading;
+global using System.Threading.Channels;
+global using System.Threading.Tasks;
\ No newline at end of file