Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tvedeane committed Jul 11, 2020
1 parent 147d742 commit 8a516a6
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -34,6 +34,7 @@ import static com.devskiller.jfairy.producer.person.PersonProperties.withNationa
import static com.devskiller.jfairy.producer.person.PersonProperties.withPassportNumber
import static com.devskiller.jfairy.producer.person.PersonProperties.withPassword
import static com.devskiller.jfairy.producer.person.PersonProperties.withTelephoneNumber
import static com.devskiller.jfairy.producer.person.PersonProperties.withMobileTelephoneNumber
import static com.devskiller.jfairy.producer.person.PersonProperties.withUsername

class PersonSpec extends Specification {
Expand Down Expand Up @@ -304,6 +305,20 @@ class PersonSpec extends Specification {
person.telephoneNumber == "01234556789"
}

def "withMobileTelephoneNumber should create person with specific telephoneNumber"() {
when:
Person person = fairy.person(withMobileTelephoneNumber("01234556789"))
then:
person.telephoneNumber == "01234556789"
}

def "withMobileTelephoneNumberFormat and mobileTelephoneFormat used together should create person with specific telephoneNumber"() {
when:
Person person = fairy.person(mobileTelephoneFormat("###--###"), withMobileTelephoneNumber("01234556789"))
then:
person.telephoneNumber == "01234556789"
}

def "withDateOfBirth should create person with specific date of birth"() {
when:
Person person = fairy.person(withDateOfBirth(LocalDate.parse("2000-01-01")))
Expand Down

0 comments on commit 8a516a6

Please sign in to comment.