feat: update Godot integration and coordinated package dependencies
This commit is contained in:
3 files changed
+17
-16
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
@@ -9,6 +10,7 @@ using ShrinkContext;
|
||||
using ShrinkDataSaver.Integration.App;
|
||||
using ShrinkNetwork;
|
||||
using ShrinkNetwork.Integration.App;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace ShrinkCommand.Integration.Network.Tests
|
||||
{
|
||||
@@ -27,10 +29,10 @@ namespace ShrinkCommand.Integration.Network.Tests
|
||||
_runtime = new ShrinkContextRuntime();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
[UnityTearDown]
|
||||
public IEnumerator TearDown()
|
||||
{
|
||||
_runtime.ShutdownAsync().GetAwaiter().GetResult();
|
||||
yield return _runtime.ShutdownAsync().ToCoroutine();
|
||||
}
|
||||
|
||||
private static void Run(UniTask task) => task.GetAwaiter().GetResult();
|
||||
@@ -83,16 +85,15 @@ namespace ShrinkCommand.Integration.Network.Tests
|
||||
ShrinkCommandAppComponent.ServiceKey, out _), "退役撤回服务键");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DataSaverComponent_Activates_FlushesOnDeactivate_WithdrawsKey()
|
||||
[UnityTest]
|
||||
public IEnumerator DataSaverComponent_Activates_FlushesOnDeactivate_WithdrawsKey()
|
||||
{
|
||||
var fiber = _runtime.Use(new ShrinkDataSaverAppComponent());
|
||||
Assert.AreEqual(ShrinkFiberState.Active, fiber.State);
|
||||
Assert.IsTrue(_runtime.TryGetRaw<object>(_runtime.RootContext,
|
||||
ShrinkDataSaverAppComponent.ServiceKey, out _));
|
||||
|
||||
Assert.DoesNotThrow(() => Run(_runtime.RetireAsync(fiber)),
|
||||
"停用执行补偿式收尾(设置最终落盘;未初始化环境安全跳过)");
|
||||
yield return _runtime.RetireAsync(fiber).ToCoroutine();
|
||||
Assert.IsFalse(_runtime.TryGetRaw<object>(_runtime.RootContext,
|
||||
ShrinkDataSaverAppComponent.ServiceKey, out _));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user