Skip to content

Commit

Permalink
add marketplace test case
Browse files Browse the repository at this point in the history
  • Loading branch information
haidang91 committed Apr 15, 2020
1 parent e88dce8 commit 469a50a
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions test/truffle/verifier2.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function getBlock(blockNumber) {
}

contract('MarketCore', function (accounts) {
let account = accounts[0]
let account = accounts[0];
let buyer = accounts[1];
let marketCore;
let registry;
let sigObj;
Expand Down Expand Up @@ -90,14 +91,30 @@ contract('MarketCore', function (accounts) {
})

it("should set the price of an application", async () => {

let tx = await marketCore.createSale(entity.address, 100);

})

it("user should be able to purchase it", async () => {
console.log(buyer)
let licenseID = await marketCore.purchaseService(entity.address, buyer, 22000, {from: buyer, value: '100'});
// owner of the license is the buyer !
assert.equal(await marketCore.ownerOf(0), buyer);
})

it("user should be able to rate the product", async () => {
let tx = await marketCore.rateProduct(0, 5, stringToBytes32("This shit is awesome!"), {from: buyer});
console.log(tx);
})
})


})

describe("should acquire a application license", () => {
let result;

})

/* describe("verifyApp()", () => {
let sig;
Expand Down

0 comments on commit 469a50a

Please sign in to comment.