-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mintable tests for erc721 and erc1155
- Loading branch information
1 parent
fa61850
commit a4c630b
Showing
5 changed files
with
58 additions
and
3 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
23 changes: 23 additions & 0 deletions
23
libs/remix-ws-templates/src/templates/ozerc1155/tests/MyToken_mintable_test.sol
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,23 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity >=0.7.0 <0.9.0; | ||
import "remix_tests.sol"; | ||
import "remix_accounts.sol"; | ||
import "../contracts/MyToken.sol"; | ||
|
||
contract MyTokenTest { | ||
|
||
MyToken s; | ||
|
||
function beforeAll () public { | ||
address acc0 = TestsAccounts.getAccount(0); | ||
// acc0 will be set as initial owner | ||
s = new MyToken(acc0); | ||
} | ||
|
||
function testSetURI () public { | ||
string memory uri = "https://testuri.io/token"; | ||
s.setURI(uri); | ||
Assert.equal(s.uri(1), uri, "uri did not match"); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
libs/remix-ws-templates/src/templates/ozerc721/tests/MyToken_mintable_test.sol
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,22 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity >=0.7.0 <0.9.0; | ||
import "remix_tests.sol"; | ||
import "remix_accounts.sol"; | ||
import "../contracts/MyToken.sol"; | ||
|
||
contract MyTokenTest { | ||
|
||
MyToken s; | ||
|
||
function beforeAll () public { | ||
address acc0 = TestsAccounts.getAccount(0); | ||
// acc0 will be set as initial owner | ||
s = new MyToken(acc0); | ||
} | ||
|
||
function testTokenNameAndSymbol () public { | ||
Assert.equal(s.name(), "MyToken", "token name did not match"); | ||
Assert.equal(s.symbol(), "MTK", "token symbol did not match"); | ||
} | ||
} |