Replies: 2 comments 8 replies
-
Yes, we can test our withdraw function as well. And, about your second question : So, tokenURI and getDogTokenUris both will give the same results. And its upto you, If you wanna test it once or twice, Its totally fine to only test it once! In our constructor we just checked, If the constructor is initialized correctly or not! And In our fulfillRandomWords test we checked it to see, The Nft is minted or not by checking the tokenURI at 0! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
1). How do we unit test the
revert
clause in thewithdraw()
function below in RandomIpfsNft.sol ?I checked the unit tests of FundMe.sol and Raffle.sol git repos for the same
revert
but found that it wasn't tested there either.Any way we can do it ?
2). What is the need to check
assert.equal(tokenUri.toString().includes("ipfs://"), true)
infulfillRandomWords()
unit test when we've aready testedassert(dogTokenUriZero.includes("ipfs://"))
in theConstructor
unit test ?fulfillRandomWords() unit test:
Constructor unit test:
Aren't both
tokenURI("0")
&getDogTokenUris(0)
eventually checking the same thing, which is, whether our string array ofs_dogTokenUris[index]
got correctly initialized with all the 3 IPFS URIs ?Beta Was this translation helpful? Give feedback.
All reactions