Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SimpleContract = artifacts.require("SimpleContract");
- contract('SimpleContract', (accounts) => {
- let instance;
- beforeEach('should setup the contract instance', async () => {
- instance = await SimpleContract.deployed();
- });
- it("should return the name", async ()=> {
- const value = await instance.getName();
- assert.equal(value, 'my name');
- });
- it("should return change the name", async ()=> {
- await instance.changeName('your name');
- const value = await instance.getName();
- assert.equal(value, 'your name');
- });
- it('should execute only by the owner', async()=>{
- await instance.changeName('modifier');
- const value = await instance.getName();
- assert.equal(value, 'modifier');
- })
- });
Add Comment
Please, Sign In to add comment