45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using NUnit.Framework;
|
|
using SepCore.Entity;
|
|
using UnityEngine;
|
|
|
|
namespace VampireLike.Tests.Gameplay.EditMode
|
|
{
|
|
[TestFixture]
|
|
public class DropEntityTests
|
|
{
|
|
[Test]
|
|
public void DropData_ConstructsWithCorrectValues_AndDefaultAssetName()
|
|
{
|
|
var dropData = new DropData(10, 25, 1001);
|
|
|
|
Assert.AreEqual(10, dropData.CoinCount);
|
|
Assert.AreEqual(25, dropData.ExpCount);
|
|
Assert.AreEqual(1001, dropData.Id);
|
|
Assert.AreEqual("DropEntity", dropData.AssetName);
|
|
}
|
|
|
|
[Test]
|
|
public void DropData_CanModifyCoinAndExpCount()
|
|
{
|
|
var dropData = new DropData(1, 1, 1002);
|
|
dropData.CoinCount = 5;
|
|
dropData.ExpCount = 15;
|
|
|
|
Assert.AreEqual(5, dropData.CoinCount);
|
|
Assert.AreEqual(15, dropData.ExpCount);
|
|
}
|
|
|
|
[Test]
|
|
public void DropEntity_TryCollect_WhenPlayerNull_ReturnsFalse()
|
|
{
|
|
var go = new GameObject("TestDropEntity");
|
|
var dropEntity = go.AddComponent<DropEntity>();
|
|
|
|
bool collected = dropEntity.TryCollect(null);
|
|
Assert.IsFalse(collected);
|
|
|
|
Object.DestroyImmediate(go);
|
|
}
|
|
}
|
|
}
|