This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
554b1d3
commit 5682e34
Showing
4 changed files
with
36 additions
and
88 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
pragma solidity ^0.4.2; | ||
|
||
import "truffle/Assert.sol"; | ||
import "truffle/DeployedAddresses.sol"; | ||
import "../contracts/SimpleStorage.sol"; | ||
|
||
contract TestSimpleStorage { | ||
|
||
function testItStoresAValue() { | ||
SimpleStorage simpleStorage = SimpleStorage(DeployedAddresses.SimpleStorage()); | ||
|
||
simpleStorage.set(89); | ||
|
||
uint expected = 89; | ||
|
||
Assert.equal(simpleStorage.get(), expected, "It should store the value 89."); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var SimpleStorage = artifacts.require("./SimpleStorage.sol"); | ||
|
||
contract('SimpleStorage', function(accounts) { | ||
|
||
it("...should store the value 89.", function() { | ||
return SimpleStorage.deployed().then(function(instance) { | ||
simpleStorageInstance = instance; | ||
|
||
return simpleStorageInstance.set(89, {from: accounts[0]}); | ||
}).then(function() { | ||
return simpleStorageInstance.get.call(); | ||
}).then(function(storedData) { | ||
assert.equal(storedData, 89, "The value 89 was not stored."); | ||
}); | ||
}); | ||
|
||
}); |