-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
161 additions
and
263 deletions.
There are no files selected for viewing
102 changes: 0 additions & 102 deletions
102
nekoyume/Assets/Tests/EditMode/State/Modifiers/AgentGoldModifierTest.cs
This file was deleted.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
nekoyume/Assets/Tests/EditMode/State/Modifiers/AgentNCGModifierTest.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,88 @@ | ||
using Libplanet.Types.Assets; | ||
using Nekoyume.State.Modifiers; | ||
using NUnit.Framework; | ||
|
||
namespace Tests.EditMode.State.Modifiers | ||
{ | ||
public class AgentNCGModifierTest | ||
{ | ||
private Currency _currency; | ||
private FungibleAssetValue _ncgFav; | ||
|
||
[SetUp] | ||
public void SetUp() | ||
{ | ||
_currency = Currency.Legacy("NCG", 2, null); | ||
_ncgFav = new FungibleAssetValue(_currency); | ||
} | ||
|
||
[Test] | ||
public void AddTest() | ||
{ | ||
Assert.True(_ncgFav.Equals(new FungibleAssetValue(_currency))); | ||
var fav = new FungibleAssetValue(_currency, 100, 0); | ||
var modifier = new AgentNCGModifier(fav); | ||
var beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav)); | ||
|
||
var fav2 = new FungibleAssetValue(_currency, -100, 0); | ||
modifier.Add(new AgentNCGModifier(fav2)); | ||
beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav + fav2)); | ||
|
||
var fav3 = new FungibleAssetValue(_currency, -100, 0); | ||
modifier.Add(new AgentNCGModifier(fav3)); | ||
beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav + fav2 + fav3)); | ||
} | ||
|
||
[Test] | ||
public void RemoveTest() | ||
{ | ||
Assert.True(_ncgFav.Equals(new FungibleAssetValue(_currency))); | ||
var fav = new FungibleAssetValue(_currency, 100, 0); | ||
var modifier = new AgentNCGModifier(fav); | ||
var beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav)); | ||
|
||
var fav2 = new FungibleAssetValue(_currency, -100, 0); | ||
modifier.Remove(new AgentNCGModifier(fav2)); | ||
beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav - fav2)); | ||
|
||
var fav3 = new FungibleAssetValue(_currency, -100, 0); | ||
modifier.Remove(new AgentNCGModifier(fav3)); | ||
beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav - fav2 - fav3)); | ||
} | ||
|
||
[Test] | ||
public void ModifyTest() | ||
{ | ||
Assert.True(_ncgFav.Equals(new FungibleAssetValue(_currency))); | ||
var fav = new FungibleAssetValue(_currency, 100, 0); | ||
var modifier = new AgentNCGModifier(fav); | ||
var beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav)); | ||
|
||
fav = new FungibleAssetValue(_currency, -100, 0); | ||
modifier = new AgentNCGModifier(fav); | ||
beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav)); | ||
|
||
fav = new FungibleAssetValue(_currency, -100, 0); | ||
modifier = new AgentNCGModifier(fav); | ||
beforeFav = _ncgFav; | ||
_ncgFav = modifier.Modify(_ncgFav); | ||
Assert.True(_ncgFav.Equals(beforeFav + fav)); | ||
} | ||
} | ||
} |
File renamed without changes.
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
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
Oops, something went wrong.