docs: Rename test tutorial subtitle

This commit is contained in:
Andras Slemmer 2016-07-11 14:23:45 +01:00
parent e13a95857a
commit d0903ae265
2 changed files with 5 additions and 5 deletions

View File

@ -131,7 +131,7 @@ data class TestTransactionDSLInterpreter private constructor(
override fun _output(label: String?, notary: Party, contractState: ContractState) { override fun _output(label: String?, notary: Party, contractState: ContractState) {
val outputIndex = transactionBuilder.addOutputState(contractState, notary) val outputIndex = transactionBuilder.addOutputState(contractState, notary)
if (label != null) { if (label != null) {
if (labelToIndexMap.contains(label)) { if (label in labelToIndexMap) {
throw DuplicateOutputLabel(label) throw DuplicateOutputLabel(label)
} else { } else {
labelToIndexMap[label] = outputIndex labelToIndexMap[label] = outputIndex
@ -284,7 +284,7 @@ data class TestLedgerDSLInterpreter private constructor (
val wireTransaction = transactionInterpreter.toWireTransaction() val wireTransaction = transactionInterpreter.toWireTransaction()
// Record the output states // Record the output states
transactionInterpreter.labelToIndexMap.forEach { label, index -> transactionInterpreter.labelToIndexMap.forEach { label, index ->
if (labelToOutputStateAndRefs.contains(label)) { if (label in labelToOutputStateAndRefs) {
throw DuplicateOutputLabel(label) throw DuplicateOutputLabel(label)
} }
labelToOutputStateAndRefs[label] = wireTransaction.outRef(index) labelToOutputStateAndRefs[label] = wireTransaction.outRef(index)
@ -355,7 +355,7 @@ fun signAll(transactionsToSign: List<WireTransaction>, extraKeys: Array<out KeyP
require(bits == wtx.serialized) require(bits == wtx.serialized)
val signatures = ArrayList<DigitalSignature.WithKey>() val signatures = ArrayList<DigitalSignature.WithKey>()
for (key in ALL_TEST_KEYS + extraKeys) { for (key in ALL_TEST_KEYS + extraKeys) {
if (allPubKeys.contains(key.public)) { if (key.public in allPubKeys) {
signatures += key.signWithECDSA(bits) signatures += key.signWithECDSA(bits)
allPubKeys -= key.public allPubKeys -= key.public
} }

View File

@ -15,8 +15,8 @@ This tutorial will take you through the steps required to write a contract test
The testing DSL allows one to define a piece of the ledger with transactions referring to each other, and ways of The testing DSL allows one to define a piece of the ledger with transactions referring to each other, and ways of
verifying their correctness. verifying their correctness.
Start with the basic Bird-fold Testing single transactions
------------------------------ ---------------------------
We start with the empty ledger: We start with the empty ledger: