Skip to content

Commit

Permalink
commenting out boilerplate test
Browse files Browse the repository at this point in the history
  • Loading branch information
KohliSuraj committed Jun 22, 2024
1 parent bffa1a8 commit 6620b12
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions packages/snfoundry/contracts/src/test/TestContract.cairo
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
use contracts::YourContract::{IYourContractDispatcher, IYourContractDispatcherTrait};
use openzeppelin::tests::utils::constants::OWNER;
use openzeppelin::utils::serde::SerializedAppend;
use snforge_std::{declare, ContractClassTrait};
use starknet::ContractAddress;
// use contracts::YourContract::{IYourContractDispatcher, IYourContractDispatcherTrait};
// use openzeppelin::tests::utils::constants::OWNER;
// use openzeppelin::utils::serde::SerializedAppend;
// use snforge_std::{declare, ContractClassTrait};
// use starknet::ContractAddress;

fn deploy_contract(name: ByteArray) -> ContractAddress {
let contract = declare(name).unwrap();
let mut calldata = array![];
calldata.append_serde(OWNER());
let (contract_address, _) = contract.deploy(@calldata).unwrap();
contract_address
}
// fn deploy_contract(name: ByteArray) -> ContractAddress {
// let contract = declare(name).unwrap();
// let mut calldata = array![];
// calldata.append_serde(OWNER());
// let (contract_address, _) = contract.deploy(@calldata).unwrap();
// contract_address
// }

#[test]
fn test_deployment_values() {
let contract_address = deploy_contract("YourContract");
// #[test]
// fn test_deployment_values() {
// let contract_address = deploy_contract("YourContract");

let dispatcher = IYourContractDispatcher { contract_address };
// let dispatcher = IYourContractDispatcher { contract_address };

let current_gretting = dispatcher.gretting();
let expected_gretting: ByteArray = "Building Unstoppable Apps!!!";
assert_eq!(current_gretting, expected_gretting, "Should have the right message on deploy");
// let current_gretting = dispatcher.gretting();
// let expected_gretting: ByteArray = "Building Unstoppable Apps!!!";
// assert_eq!(current_gretting, expected_gretting, "Should have the right message on deploy");

let new_greeting: ByteArray = "Learn Scaffold-Stark 2! :)";
dispatcher.set_gretting(new_greeting.clone(), 0); // we transfer 0 eth
// let new_greeting: ByteArray = "Learn Scaffold-Stark 2! :)";
// dispatcher.set_gretting(new_greeting.clone(), 0); // we transfer 0 eth

assert_eq!(dispatcher.gretting(), new_greeting, "Should allow setting a new message");
}
// assert_eq!(dispatcher.gretting(), new_greeting, "Should allow setting a new message");
// }

0 comments on commit 6620b12

Please sign in to comment.