Spock
30/09/2015 12:26
def "can you figure out what I'm up to?"() {
expect:
name.size() == length
where:
nam | length
"Mob" ? ? ? | 6
"Kirk" | ?4
"Spock" ? ? ? ?| ?5
"Scott ? ? ?| ?6
}
def "test validate fail because customer not found" () {
??expect:
???controller.validate()
println controller.response.contentAsString
def result = new XmlSlurper().parseText(controller.response.contentAsString )
println 'Return code: ' + result.returncode
result.returncode == false
where:
params.customerId | params.name | params.sharedSecret | params.ePortfolioUrl | params.validated
'1234' | 'test-customer1' | 'shared_secret' | 'url' | false
'1235' | 'test-customer2' | 'shared_secret' | 'url' | false
'1236' | 'test-customer3' | 'shared_secret' | 'url' | false
'1237' | 'test-customer4' | 'shared_secret' | 'url' | false
'1238' | 'test-customer5' | 'shared_secret' | 'url' | false
'1239' | 'test-customer6' | 'shared_secret' | 'url' | false
'1240' | 'test-customer7' | 'shared_secret' | 'url' | false
'1241' | 'test-customer8' | 'shared_secret' | 'url' | false
'1242' | 'test-customer9' | 'shared_secret' | 'url' | false
'1243' | 'test-customer10' | 'shared_secret' | 'url' | false
'1244' | 'test-customer11' | 'shared_secret' | 'url' | false
'1245' | 'test-customer12' | 'shared_secret' | 'url' | false
'1246' | 'test-customer13' | 'shared_secret' | 'url' | false
'1247' | 'test-customer14' | 'shared_secret' | 'url' | false
'1248' | 'test-customer15' | 'shared_secret' | 'url' | false
'1249' | 'test-customer16' | 'shared_secret' | 'url' | false
'1250' | 'test-customer17' | 'shared_secret' | 'url' | false
'1251' | 'test-customer18' | 'shared_secret' | 'url' | false
'1252' | 'test-customer19' | 'shared_secret' | 'url' | false
'1253' | 'test-customer20' | 'shared_secret' | 'url' | false
}
expect:
params.customerId = valorId
params.name = nome
controller.facaAlgo()
where:
valorId | nome
'1234' | 'quente'
def "faca na caveira" () {
setup:
params.customerId = valorId
params.name = nome
params.sharedSecret = pass
params.ePortfolioUrl = url
params.validated = val
??when:
controller.validate()
then:
def result = new XmlSlurper().parseText(controller.response.contentAsString )
result.returncode == false
where:
valorId ? ?| ?nom ? | pass | url | val
'1234' ? ?| 'test-customer1' | 'shared_secret' | 'url' | false
'1235' | 'test-customer2' | 'shared_secret' | 'url' | false
'1236' ? ?| ?'test-customer3' | 'shared_secret' | 'url'
'1253' | 'test-customer20' | 'shared_secret' | 'url' | false
}
Para se registrar, clique aqui.