2023-07-28 18:29:45 -04:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.TestTools;
|
|
|
|
|
|
|
|
public class AttributeTest
|
|
|
|
{
|
|
|
|
[Test]
|
2023-07-30 11:58:19 -04:00
|
|
|
[TestCase(1000000, 0, 0, 0, ExpectedResult = 1000000)]
|
|
|
|
[TestCase(1000000, 1, 0, 0, ExpectedResult = 1000001)]
|
|
|
|
[TestCase(1000000, 0, 2, 0, ExpectedResult = 1000200)]
|
|
|
|
[TestCase(1000000, 0, 0, 10000, ExpectedResult = 1010000)]
|
|
|
|
[TestCase(0, 1000000, 5000, 1000000, ExpectedResult = 2500000)]
|
|
|
|
[TestCase(1000000, 0, -10000, 0, ExpectedResult = 0)]
|
|
|
|
[TestCase(1000000, 0, -20000, 0, ExpectedResult = 0)]
|
|
|
|
[TestCase(1000000, 0, -20000, 0, ExpectedResult = 0)]
|
|
|
|
public long Value(long startStat, long baseBonus, long permyriadBonus, long flatBonus)
|
2023-07-28 18:29:45 -04:00
|
|
|
{
|
|
|
|
var attr = new Attribute(startStat);
|
2023-07-30 11:58:19 -04:00
|
|
|
var effect = EffectSO.New(baseBonus, permyriadBonus, flatBonus);
|
|
|
|
return attr.Calc(effect);
|
2023-07-28 18:29:45 -04:00
|
|
|
}
|
|
|
|
}
|