Vibe tests

This commit is contained in:
2026-06-18 16:53:37 -04:00
parent 3d4c9c0645
commit 5e1fe81473
3 changed files with 89 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
using Chrono.Model;
namespace Tests;
public class CardDataTests
{
[Test]
public void StatEfficiency_CalculatesCorrectly()
{
var card = new CardData { Cost = 2, Attack = 2, Health = 3 };
Assert.That(card.StatEfficiency, Is.EqualTo(2.5f));
}
[Test]
public void StatEfficiency_ReturnsZero_WhenCostIsZero()
{
var card = new CardData { Cost = 0, Attack = 2, Health = 3 };
Assert.That(card.StatEfficiency, Is.EqualTo(0f));
}
[Test]
public void StatEfficiency_ReturnsZero_WhenAttackIsNull()
{
var card = new CardData { Cost = 2, Attack = null, Health = 3 };
Assert.That(card.StatEfficiency, Is.EqualTo(0f));
}
[Test]
public void IsAgent_ReturnsTrue_WhenCategoryIsAgent()
{
var card = new CardData { Category = "Agent" };
Assert.That(card.IsAgent, Is.True);
}
[Test]
public void IsSpell_ReturnsTrue_WhenCategoryIsSpell()
{
var card = new CardData { Category = "Spell" };
Assert.That(card.IsSpell, Is.True);
}
[Test]
public void ImagePath_UsesPlaceholder_WhenImageFileIsNull()
{
var card = new CardData { ImageFile = null };
Assert.That(card.ImagePath, Is.EqualTo("cards/placeholder.png"));
}
[Test]
public void StatEfficiency_RoundsToTwoDecimalPlaces()
{
var card = new CardData { Cost = 3, Attack = 1, Health = 1 }; // (1+1)/3 = 0.666...
Assert.That(card.StatEfficiency, Is.EqualTo(0.67f));
}
}