Kursach_StealthAction/Assets/Scripts/Editor/SynthesiaSystemTests.cs

31 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}