Guest User

Untitled

a guest
Nov 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. const SimpleContract = artifacts.require("SimpleContract");
  2.  
  3. contract('SimpleContract', (accounts) => {
  4.  
  5. let instance;
  6. beforeEach('should setup the contract instance', async () => {
  7. instance = await SimpleContract.deployed();
  8. });
  9.  
  10. it("should return the name", async ()=> {
  11. const value = await instance.getName();
  12.  
  13. assert.equal(value, 'my name');
  14. });
  15.  
  16. it("should return change the name", async ()=> {
  17. await instance.changeName('your name');
  18. const value = await instance.getName();
  19.  
  20. assert.equal(value, 'your name');
  21. });
  22.  
  23. it('should execute only by the owner', async()=>{
  24. await instance.changeName('modifier');
  25. const value = await instance.getName();
  26.  
  27. assert.equal(value, 'modifier');
  28. })
  29.  
  30. });
Add Comment
Please, Sign In to add comment