-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: burner damage was lower than expected
Burner unit tests
- Loading branch information
1 parent
e27022b
commit c2b45b1
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
source/TextBlade.Core.Tests/Battle/Statuses/BurnerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Text.RegularExpressions; | ||
using NUnit.Framework; | ||
using TextBlade.Core.Battle.Statuses; | ||
using TextBlade.Core.Characters; | ||
|
||
namespace TextBlade.Core.Tests.Battle.Statuses; | ||
|
||
[TestFixture] | ||
public class BurnerTests | ||
{ | ||
[Test] | ||
public void Burn_CausesDamageUpToCurrentHealth() | ||
{ | ||
// Arrange | ||
var e = new Monster("TestMon", 1000, 1, 1); | ||
|
||
// Act | ||
var message = Burner.Burn(e); | ||
|
||
// Assert | ||
var actual = int.Parse(Regex.Match(message, @"\](\d+)\[").Groups[1].Value); | ||
Assert.That(actual, Is.LessThan(e.TotalHealth)); | ||
Assert.That(e.CurrentHealth, Is.EqualTo(e.TotalHealth - actual)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters