-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request #2799 from planetarium/bump-lib9c-0.3.0"
- Loading branch information
Showing
5 changed files
with
106 additions
and
7 deletions.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
nekoyume/Assets/Tests/EditMode/Battle/AttackCountHelperTest.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,98 @@ | ||
using System; | ||
using Nekoyume.Battle; | ||
using NUnit.Framework; | ||
|
||
namespace Tests.EditMode.Battle | ||
{ | ||
public class AttackCountHelperTest | ||
{ | ||
[Test] | ||
public void GetCountMax() | ||
{ | ||
var level = 1; | ||
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, AttackCountHelper.GetCountMax(level)); | ||
level = 20; | ||
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 1, AttackCountHelper.GetCountMax(level)); | ||
level = 100; | ||
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 2, AttackCountHelper.GetCountMax(level)); | ||
level = 250; | ||
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 3, AttackCountHelper.GetCountMax(level)); | ||
level = 999; | ||
Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, AttackCountHelper.GetCountMax(level)); | ||
} | ||
|
||
[Test] | ||
public void GetDamageMultiplier() | ||
{ | ||
for (var i = 0; i < 2; i++) | ||
{ | ||
var level = i == 0 | ||
? 1 | ||
: 999; | ||
var attackCount = 0; | ||
var attackCountMax = AttackCountHelper.GetCountMax(level); | ||
|
||
switch (level) | ||
{ | ||
case 1: | ||
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, attackCountMax); | ||
break; | ||
case 999: | ||
Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, attackCountMax); | ||
break; | ||
} | ||
|
||
for (var j = 0; j < attackCountMax + 1; j++) | ||
{ | ||
attackCount++; | ||
if (attackCount <= attackCountMax) | ||
{ | ||
var info = AttackCountHelper.CachedInfo[attackCountMax][attackCount]; | ||
Assert.AreEqual(info.DamageMultiplier, AttackCountHelper.GetDamageMultiplier(attackCount, attackCountMax)); | ||
|
||
continue; | ||
} | ||
|
||
Assert.Throws<ArgumentOutOfRangeException>(() => AttackCountHelper.GetDamageMultiplier(attackCount, attackCountMax)); | ||
} | ||
} | ||
} | ||
|
||
[Test] | ||
public void GetAdditionalCriticalChance() | ||
{ | ||
for (var i = 0; i < 2; i++) | ||
{ | ||
var level = i == 0 | ||
? 1 | ||
: 999; | ||
var attackCount = 0; | ||
var attackCountMax = AttackCountHelper.GetCountMax(level); | ||
|
||
switch (level) | ||
{ | ||
case 1: | ||
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, attackCountMax); | ||
break; | ||
case 999: | ||
Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, attackCountMax); | ||
break; | ||
} | ||
|
||
for (var j = 0; j < attackCountMax + 1; j++) | ||
{ | ||
attackCount++; | ||
if (attackCount <= attackCountMax) | ||
{ | ||
var info = AttackCountHelper.CachedInfo[attackCountMax][attackCount]; | ||
Assert.AreEqual(info.AdditionalCriticalChance, AttackCountHelper.GetAdditionalCriticalChance(attackCount, attackCountMax)); | ||
|
||
continue; | ||
} | ||
|
||
Assert.Throws<ArgumentOutOfRangeException>(() => AttackCountHelper.GetAdditionalCriticalChance(attackCount, attackCountMax)); | ||
} | ||
} | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
nekoyume/Assets/Tests/EditMode/Battle/AttackCountHelperTest.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Submodule lib9c
updated
40 files