mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +08:00
- 将所有小写的命名空间导入更正为首字母大写格式 - 统一 GFramework 框架的命名空间引用规范 - 修复 core、ecs、godot 等模块的命名空间导入错误 - 标准化文档示例代码中的 using 语句格式 - 确保所有文档中的命名空间引用保持一致性 - 更新 global using 语句以匹配正确的命名空间格式
55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using GFramework.Core.Coroutine.Instructions;
|
|
using NUnit.Framework;
|
|
|
|
namespace GFramework.Core.Tests.Coroutine
|
|
{
|
|
[TestFixture]
|
|
public class WaitUntilTests
|
|
{
|
|
[Test]
|
|
public void Constructor_WithNullPredicate_ThrowsArgumentNullException()
|
|
{
|
|
// Act & Assert
|
|
Assert.Throws<ArgumentNullException>(() => new WaitUntil(null!));
|
|
}
|
|
|
|
[Test]
|
|
public void IsDone_ReturnsPredicateResult_True()
|
|
{
|
|
// Arrange
|
|
var condition = false;
|
|
var waitUntil = new WaitUntil(() => condition);
|
|
|
|
// Act
|
|
condition = true;
|
|
|
|
// Assert
|
|
Assert.That(waitUntil.IsDone, Is.True);
|
|
}
|
|
|
|
[Test]
|
|
public void IsDone_ReturnsPredicateResult_False()
|
|
{
|
|
// Arrange
|
|
var condition = false;
|
|
var waitUntil = new WaitUntil(() => condition);
|
|
|
|
// Assert
|
|
Assert.That(waitUntil.IsDone, Is.False);
|
|
}
|
|
|
|
[Test]
|
|
public void Update_DoesNotChangeState()
|
|
{
|
|
// Arrange
|
|
var condition = false;
|
|
var waitUntil = new WaitUntil(() => condition);
|
|
|
|
// Act
|
|
waitUntil.Update(0.1);
|
|
|
|
// Assert
|
|
Assert.That(waitUntil.IsDone, Is.False);
|
|
}
|
|
}
|
|
} |