idle-survivors/Assets/Tests/AttributeTest.cs
Branden J Brown 541cdfeed3
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
add Attribute definition
Updates #2.
2023-07-23 14:18:29 -05:00

26 lines
1002 B
C#

using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
public class AttributeTest
{
[Test]
[TestCase(1000000, 0, 0, 0, 0, ExpectedResult = 1000000)]
[TestCase(1000000, 1, 0, 0, 0, ExpectedResult = 1000001)]
[TestCase(1000000, 0, 2, 0, 0, ExpectedResult = 1000002)]
[TestCase(1000000, 0, 0, 10000, 0, ExpectedResult = 2000000)]
[TestCase(1000000, 0, 0, 0, 3, ExpectedResult = 1000003)]
[TestCase(0, 1000000, 1000000, 5000, 1000, ExpectedResult = 3001000)]
[TestCase(1000000, 0, 0, -10000, 0, ExpectedResult = 0)]
[TestCase(1000000, 0, 0, -20000, 0, ExpectedResult = 0)]
[TestCase(1000000, 0, 0, -20000, 50, ExpectedResult = 0)]
public long Calc(long startStat, long levelUp, long baseBonus, long permyriadBonus, long flatBonus)
{
var attr = new Attribute(startStat);
attr.LevelUp(levelUp);
return attr.Calc(baseBonus, permyriadBonus, flatBonus);
}
}