Hi,
I can’t describe how to translate my analyst sentences according to BDD. My first sentence is “list accounts counts of the accounts different from 1 the account balance should different from 0, try to select a destination account.”
I think;
override func spec() {
describe(“list accounts”) {
context(“count of accounts different from 1”) {
it(“the account balance should different from 0”) {
try! try select.destination.account
// bla bla…
}
}
}
}
IS it true ? Please check and say your commit.
Thank you,
I am new in BDD and I try to develop unit test according to BDD. I am not sure what I did. My first question is about my first unit test case. Now, is it understandable?
describe() is used to define what action or behavior you’ll be testing.
context() is used to define the specific context of the action you’ll be testing.
it() is used to define the specific expected result for the test.
You play a random move on the Board class using playRandom() .
From what I see in your test above it appears you want to test the accounts that are different from 1 by counting them? And the result should expect the account balance should be different from 0?