тестирование
This commit is contained in:
1 parent
11d290d572
commit
570e778cda
39 files changed
+2007
-97
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
|
||||
public class SynthesiaSystemTests
|
||||
{
|
||||
[Test]
|
||||
public void BossArena_UnlocksDoors_WhenTitanHealthReachesZero()
|
||||
{
|
||||
// Arrange (Настройка тестового окружения арены и босса)
|
||||
var arenaObj = new GameObject("BossArena");
|
||||
var arenaController = arenaObj.AddComponent<BossArenaController>();
|
||||
|
||||
var bossObj = new GameObject("TitanBoss");
|
||||
var bossHealth = bossObj.AddComponent<MutantHealth>();
|
||||
bossHealth.SetMaxHealthForTest(200f);
|
||||
arenaController.BindBossForTest(bossHealth);
|
||||
arenaController.LockArenaDoors();
|
||||
|
||||
// Act (Нанесение летального урона боссу)
|
||||
bossHealth.TakeDamage(200f);
|
||||
|
||||
// Assert (Проверка разблокировки гермозатворов арены)
|
||||
Assert.AreEqual(0f, bossHealth.CurrentHealth);
|
||||
Assert.IsFalse(arenaController.AreDoorsLocked);
|
||||
|
||||
// Cleanup
|
||||
if (arenaObj != null) Object.DestroyImmediate(arenaObj);
|
||||
if (bossObj != null) Object.DestroyImmediate(bossObj);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user