diff --git a/README.md b/README.md
index ad3101c..40a842c 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@
**使用Nuget安装**
```PM
-Install-Package CatLib.Core -Version 1.2.12
+Install-Package CatLib.Core -Version 1.3.0
```
**直接下载发布版本**
diff --git a/src/CatLib.Core.NetStandard/CatLib.Core.NetStandard.csproj b/src/CatLib.Core.NetStandard/CatLib.Core.NetStandard.csproj
index 8922f1d..1a3c472 100644
--- a/src/CatLib.Core.NetStandard/CatLib.Core.NetStandard.csproj
+++ b/src/CatLib.Core.NetStandard/CatLib.Core.NetStandard.csproj
@@ -69,6 +69,7 @@
+
@@ -97,6 +98,7 @@
+
diff --git a/src/CatLib.Core.Tests/CatLib.Core.Tests.csproj b/src/CatLib.Core.Tests/CatLib.Core.Tests.csproj
index 51cf865..84778c3 100644
--- a/src/CatLib.Core.Tests/CatLib.Core.Tests.csproj
+++ b/src/CatLib.Core.Tests/CatLib.Core.Tests.csproj
@@ -52,7 +52,9 @@
+
+
diff --git a/src/CatLib.Core.Tests/CatLib/ApplicationTests.cs b/src/CatLib.Core.Tests/CatLib/ApplicationTests.cs
index fb1595e..b8a5ce7 100644
--- a/src/CatLib.Core.Tests/CatLib/ApplicationTests.cs
+++ b/src/CatLib.Core.Tests/CatLib/ApplicationTests.cs
@@ -10,6 +10,7 @@
*/
using System;
+using System.Collections;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CatLib.Tests
@@ -63,8 +64,32 @@ public void Register()
}
}
+ public class TestYieldProvider : ServiceProvider
+ {
+ public bool IsDone;
+ public override IEnumerator CoroutineInit()
+ {
+ IsDone = true;
+ yield return 1;
+ yield return 2;
+ yield return base.CoroutineInit();
+ }
+ }
+
[TestMethod]
- [ExpectedException(typeof(RuntimeException))]
+ public void TestYieldProviderTest()
+ {
+ var app = new Application();
+ app.Bootstrap();
+ var test = new TestYieldProvider();
+ app.Register(test);
+ app.Init();
+
+ Assert.AreEqual(true, test.IsDone);
+ }
+
+ [TestMethod]
+ [ExpectedException(typeof(CodeStandardException))]
public void RepeatInitTest()
{
var app = MakeApplication();
@@ -171,12 +196,12 @@ public void TestStopRegisterProvider()
}
[TestMethod]
- [ExpectedException(typeof(RuntimeException))]
+ [ExpectedException(typeof(CodeStandardException))]
public void TestInitingRegisterProvider()
{
var application = Application.New();
application.Register(new StopProvider());
- application.On(ApplicationEvents.OnIniting, (b) =>
+ application.On(ApplicationEvents.OnProviderInit, (b) =>
{
application.Register(new TestServiceProvider());
});
@@ -185,7 +210,7 @@ public void TestInitingRegisterProvider()
}
[TestMethod]
- [ExpectedException(typeof(RuntimeException))]
+ [ExpectedException(typeof(CodeStandardException))]
public void TestTerminateRegisterProvider()
{
var application = Application.New();
@@ -263,15 +288,15 @@ public void GetCurrentProcess()
[TestMethod]
public void TestDebugLevel()
{
- App.DebugLevel = DebugLevels.Dev;
- Assert.AreEqual(DebugLevels.Dev, App.DebugLevel);
+ App.DebugLevel = DebugLevels.Development;
+ Assert.AreEqual(DebugLevels.Development, App.DebugLevel);
}
///
/// 重复的引导测试
///
[TestMethod]
- [ExpectedException(typeof(RuntimeException))]
+ [ExpectedException(typeof(CodeStandardException))]
public void RepeatBootstrap()
{
var app = new Application();
@@ -441,6 +466,22 @@ public void TestIsMainThread()
Assert.AreEqual(true, app.IsMainThread);
}
+ public class TestRegisterProcessMakeServiceProvider : ServiceProvider
+ {
+ public override void Register()
+ {
+ App.Make