2015-10-12 14:50:52 +00:00
|
|
|
var assert = require('assert');
|
|
|
|
var Embark = require('embark-framework');
|
|
|
|
var EmbarkSpec = Embark.initTests();
|
2016-05-30 00:14:27 +00:00
|
|
|
var web3 = EmbarkSpec.web3;
|
2015-10-12 14:50:52 +00:00
|
|
|
|
2016-05-30 00:14:27 +00:00
|
|
|
describe("SimpleStorage", function() {
|
2015-10-12 14:50:52 +00:00
|
|
|
before(function(done) {
|
2016-05-30 00:14:27 +00:00
|
|
|
EmbarkSpec.sim.createAccounts(10, function() {
|
|
|
|
EmbarkSpec.sim.setBalance(web3.eth.accounts[0], 1000000000000000000000, function() {
|
|
|
|
EmbarkSpec.deployAll(done);
|
2016-08-10 11:59:23 +00:00
|
|
|
// or
|
|
|
|
// EmbarkSpec.deployContract('SimpleStorage', [100], done);
|
2016-05-30 00:14:27 +00:00
|
|
|
});
|
|
|
|
});
|
2015-10-12 14:50:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should set constructor value", function(done) {
|
|
|
|
SimpleStorage.storedData(function(err, result) {
|
|
|
|
assert.equal(result.toNumber(), 100);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it("set storage value", function(done) {
|
|
|
|
SimpleStorage.set(150, function() {
|
|
|
|
SimpleStorage.get(function(err, result) {
|
|
|
|
assert.equal(result.toNumber(), 150);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-08-10 11:59:23 +00:00
|
|
|
});
|