You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though I celebrate the content of written lesson about the different layers of testing it doesn't match to the video content. Unfortunately, I haven't found the video for "Leveling up testing". I would really appreciate a video about this content!
The written lesson should have covered the following test + the challenge to write some tests:
///////////////////////// Constructor Tests /////////////////////////address[] public tokenAddresses;
address[] public feedAddresses;
function testRevertsIfTokenLengthDoesntMatchPriceFeeds() public {
tokenAddresses.push(weth);
feedAddresses.push(ethUsdPriceFeed);
feedAddresses.push(btcUsdPriceFeed);
vm.expectRevert(DSCEngine.DSCEngine__TokenAddressesAndPriceFeedAddressesMustBeSameLength.selector);
newDSCEngine(tokenAddresses, feedAddresses, address(dsc));
}
...
function testGetTokenAmountFromUsd() public {
// If we want $100 of WETH @ $2000/WETH, that would be 0.05 WETHuint256 expectedWeth =0.05ether;
uint256 amountWeth = dsce.getTokenAmountFromUsd(weth, 100 ether);
assertEq(amountWeth, expectedWeth);
}
....
modifier depositedCollateral() {
vm.startPrank(USER);
ERC20Mock(weth).approve(address(dsce), AMOUNT_COLLATERAL);
dsce.depositCollateral(weth, AMOUNT_COLLATERAL);
vm.stopPrank();
_;
}
function testCanDepositedCollateralAndGetAccountInfo() public depositedCollateral {
(uint256totalDscMinted, uint256collateralValueInUsd) = dsce.getAccountInformation(USER);
uint256 expectedDepositedAmount = dsce.getTokenAmountFromUsd(weth, collateralValueInUsd);
assertEq(totalDscMinted, 0);
assertEq(expectedDepositedAmount, AMOUNT_COLLATERAL);
}
But it covers something about layers of testing:
The text was updated successfully, but these errors were encountered:
Hello @MrRobWeb, Thanks for raising this, but every written lesson is directly on the same page as its video content, so I will assume DSCEngine advanced testing is the video content of the Leveling up testing written lesson. @Equious, correct me if I am wrong, sir.
Hello @MrRobWeb, Thanks for raising this, but every written lesson is directly on the same page as its video content, so I will assume DSCEngine advanced testing is the video content of the Leveling up testing written lesson. @Equious, correct me if I am wrong, sir.
Even though I celebrate the content of written lesson about the different layers of testing it doesn't match to the video content. Unfortunately, I haven't found the video for "Leveling up testing". I would really appreciate a video about this content!
The written lesson should have covered the following test + the challenge to write some tests:
But it covers something about layers of testing:
The text was updated successfully, but these errors were encountered: