Value assignment:
it("should increase the balance of the contract when a new person is created", async function(){
instance = await People.deployed();
let balanceBefore = await instance.balance();
await instance.createPerson("Bob", 65, 190, {value: web3.utils.toWei("1", "ether")});
let balanceAfter = await instance.balance();
assert(parseInt(balanceAfter) === (parseInt(balanceBefore) + parseInt(web3.utils.toWei("1", "ether"))));
});
it("should match balance on the contract with the balance for the contract address on the blockchain", async function(){
instance = await People.deployed();
let balance = await instance.balance();
let balanceOnBlockChain = await web3.eth.getBalance(instance.address)
assert (parseInt(balance) === parseInt(balanceOnBlockChain));
});
it("shouldn't let non owner withdraw", async function(){
let instance = await People.deployed();
await truffleAssert.fails(instance.withdrawAll({from: accounts[1]}));
});
it("should allow the contract owner to withdraw", async function(){
let instance = await People.deployed();
await truffleAssert.passes(instance.withdrawAll());
let balance = await instance.balance();
assert(parseInt(balance) === 0);
});