39 lines
No EOL
677 B
C#
39 lines
No EOL
677 B
C#
using Domain;
|
|
using NUnit.Framework;
|
|
|
|
namespace Tests {
|
|
public class ScoreTests {
|
|
[Test]
|
|
public void OneIteration_UpdatesGrowPercentage() {
|
|
Score sut = new(5, 5);
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
sut.Add();
|
|
}
|
|
|
|
Assert.AreEqual(1f / 5f, sut.GrowPercentage);
|
|
}
|
|
|
|
[Test]
|
|
public void AllIterations_GrowCompleted() {
|
|
Score sut = new(5, 5);
|
|
|
|
for (int i = 0; i < 5 * 5; i++) {
|
|
sut.Add();
|
|
}
|
|
|
|
Assert.AreEqual(1f, sut.GrowPercentage);
|
|
}
|
|
|
|
[Test]
|
|
public void MoreIterations_ResetsGrowPercentage() {
|
|
Score sut = new(5, 5);
|
|
|
|
for (int i = 0; i < 6 * 5; i++) {
|
|
sut.Add();
|
|
}
|
|
|
|
Assert.AreEqual(1f / 5f, sut.GrowPercentage);
|
|
}
|
|
}
|
|
} |