-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes proof-period message in chain-events. Fixes asserts in marketpl…
…ace tests.
- Loading branch information
1 parent
25a7a30
commit c421fab
Showing
7 changed files
with
163 additions
and
44 deletions.
There are no files selected for viewing
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
46 changes: 46 additions & 0 deletions
46
Tests/FrameworkTests/CodexContractsPlugin/TestTokensEqualityTests.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,46 @@ | ||
using NUnit.Framework; | ||
using Utils; | ||
|
||
namespace FrameworkTests.CodexContractsPlugin | ||
{ | ||
[TestFixture] | ||
public class TestTokenEqualityTests | ||
{ | ||
[Test] | ||
[Combinatorial] | ||
public void Equal( | ||
[Values(1, 22, 333, 4444, 55555)] int amount, | ||
[Values(true, false)] bool isWei | ||
) | ||
{ | ||
var amount1 = CreateTst(amount, isWei); | ||
var amount2 = CreateTst(amount, isWei); | ||
|
||
Assert.That(amount1, Is.EqualTo(amount2)); | ||
Assert.That(amount1 == amount2); | ||
Assert.That(!(amount1 != amount2)); | ||
} | ||
|
||
[Test] | ||
[Combinatorial] | ||
public void NotEqual( | ||
[Values(22, 333, 4444, 55555)] int amount, | ||
[Values(true, false)] bool isWei, | ||
[Values(1, 2, 10, -1, -2, -10)] int deltaWei | ||
) | ||
{ | ||
var amount1 = CreateTst(amount, isWei); | ||
var amount2 = CreateTst(amount, isWei) + deltaWei.TstWei(); | ||
|
||
Assert.That(amount1, Is.Not.EqualTo(amount2)); | ||
Assert.That(amount1 != amount2); | ||
Assert.That(!(amount1 == amount2)); | ||
} | ||
|
||
private TestToken CreateTst(int amount, bool isWei) | ||
{ | ||
if (isWei) return amount.TstWei(); | ||
return amount.Tst(); | ||
} | ||
} | ||
} |
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,46 @@ | ||
using NUnit.Framework; | ||
using Utils; | ||
|
||
namespace FrameworkTests.Utils | ||
{ | ||
[TestFixture] | ||
public class EtherEqualityTests | ||
{ | ||
[Test] | ||
[Combinatorial] | ||
public void Equal( | ||
[Values(1, 22, 333, 4444, 55555)] int amount, | ||
[Values(true, false)] bool isWei | ||
) | ||
{ | ||
var amount1 = CreateEth(amount, isWei); | ||
var amount2 = CreateEth(amount, isWei); | ||
|
||
Assert.That(amount1, Is.EqualTo(amount2)); | ||
Assert.That(amount1 == amount2); | ||
Assert.That(!(amount1 != amount2)); | ||
} | ||
|
||
[Test] | ||
[Combinatorial] | ||
public void NotEqual( | ||
[Values(22, 333, 4444, 55555)] int amount, | ||
[Values(true, false)] bool isWei, | ||
[Values(1, 2, 10, -1, -2, -10)] int deltaWei | ||
) | ||
{ | ||
var amount1 = CreateEth(amount, isWei); | ||
var amount2 = CreateEth(amount, isWei) + deltaWei.Wei(); | ||
|
||
Assert.That(amount1, Is.Not.EqualTo(amount2)); | ||
Assert.That(amount1 != amount2); | ||
Assert.That(!(amount1 == amount2)); | ||
} | ||
|
||
private Ether CreateEth(int amount, bool isWei) | ||
{ | ||
if (isWei) return amount.Wei(); | ||
return amount.Eth(); | ||
} | ||
} | ||
} |
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