Adding the mergeAssets unit test

Let's add the content of this additional test case to the test/logic.js file:

 describe('MergeAssets()', () => { it('should change the value to ' + assetType + ' to 200', () => { const factory = businessNetworkConnection.getBusinessNetwork().getFactory(); // Create the asset 1 const asset1 = factory.newResource(namespace, assetType, 'ASSET_001'); asset1.value = 100; // Create the asset 2 const asset2 = factory.newResource(namespace, assetType, 'ASSET_002'); asset2.value = 100; // Create a transaction to change the asset's value property const mergeAssetTx = factory.newTransaction(namespace, 'MergeAssets'); mergeAssetTx.mergeFrom = factory.newRelationship(namespace, assetType, asset1.$identifier); mergeAssetTx ...

Get Blockchain Development with Hyperledger now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.