test(enemy): AbilityRef 补测资产已挂但 abilityId 为空的误配路径
This commit is contained in:
@@ -42,5 +42,18 @@ namespace BaseGames.Tests.EditMode.AI
|
||||
Assert.IsTrue(r.HasConflict); // 供校验器报警告
|
||||
Object.DestroyImmediate(so);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AssetWithEmptyId_IsEmpty()
|
||||
{
|
||||
// 资产挂了但其 abilityId 没填——校验器要能抓到的误配路径,
|
||||
// 此处钉住契约:IsEmpty 为真、Id 为空,不因"挂了资产"就当作已配置。
|
||||
var so = ScriptableObject.CreateInstance<EnemyAbilitySO>();
|
||||
so.abilityId = "";
|
||||
AbilityRef r = so;
|
||||
Assert.IsTrue(r.IsEmpty);
|
||||
Assert.IsEmpty(r.Id);
|
||||
Object.DestroyImmediate(so);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user