UT: Test offer counts.

This commit is contained in:
Arthur Britto
2012-12-14 21:21:27 -08:00
parent 12a4ce88ec
commit fd0bd1433f
3 changed files with 83 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ buster.testRunner.timeout = 5000;
buster.testCase("Offer tests", {
'setUp' : testutils.build_setup(),
// 'setUp' : testutils.build_setup({ verbose: true }),
'tearDown' : testutils.build_teardown(),
"offer create then cancel in one ledger" :
@@ -344,6 +345,11 @@ buster.testCase("Offer tests", {
testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback);
},
function (callback) {
self.what = "Owner count undefined.";
testutils.verify_owner_count(self.remote, "bob", undefined, callback);
},
function (callback) {
self.what = "Set limits.";
@@ -354,6 +360,16 @@ buster.testCase("Offer tests", {
},
callback);
},
function (callback) {
self.what = "Owner counts after trust.";
testutils.verify_owner_counts(self.remote,
{
"alice" : 1,
"bob" : 1,
},
callback);
},
function (callback) {
self.what = "Distribute funds.";
@@ -376,6 +392,16 @@ buster.testCase("Offer tests", {
})
.submit();
},
function (callback) {
self.what = "Owner counts after offer create.";
testutils.verify_owner_counts(self.remote,
{
"alice" : 1,
"bob" : 2,
},
callback);
},
function (callback) {
self.what = "Verify offer balance.";
@@ -409,6 +435,16 @@ buster.testCase("Offer tests", {
testutils.verify_offer_not_found(self.remote, "bob", seq, callback);
},
function (callback) {
self.what = "Owner counts after consumed.";
testutils.verify_owner_counts(self.remote,
{
"alice" : 1,
"bob" : 1,
},
callback);
},
], function (error) {
buster.refute(error, self.what);
done();