Skip to content

Commit

Permalink
Merge pull request ddd-by-examples#59 from delor/fix-typo
Browse files Browse the repository at this point in the history
fix typo in AddBookToCatalogueTest
  • Loading branch information
pilloPl authored Jul 2, 2020
2 parents 9f0e35d + d29fbea commit 455543d
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ class AddBookToCatalogueTest extends Specification {

CatalogueDatabase catalogueDatabase = Stub()
DomainEvents domainEvents = Mock()
Catalogue catalouge = new Catalogue(catalogueDatabase, domainEvents)
Catalogue catalogue = new Catalogue(catalogueDatabase, domainEvents)

def 'should add a new book to catalogue'() {
given:
databaseWorks()
when:
Try<Result> result = catalouge.addBook("Eric Evans", "DDD", DDD_ISBN_STR)
Try<Result> result = catalogue.addBook("Eric Evans", "DDD", DDD_ISBN_STR)
then:
result.isSuccess()
result.get() == Result.Success

}

def 'should add a new book instance to catalouge'() {
def 'should add a new book instance to catalogue'() {
given:
databaseWorks()
and:
thereIsBookWith(DDD_ISBN_STR)
when:
Try<Result> result = catalouge.addBookInstance(DDD_ISBN_STR, Restricted)
Try<Result> result = catalogue.addBookInstance(DDD_ISBN_STR, Restricted)
then:
result.isSuccess()
result.get() == Result.Success
Expand All @@ -47,7 +47,7 @@ class AddBookToCatalogueTest extends Specification {
and:
thereIsNoBookWith(DDD_ISBN_STR)
when:
Try<Result> result = catalouge.addBookInstance(DDD_ISBN_STR, Restricted)
Try<Result> result = catalogue.addBookInstance(DDD_ISBN_STR, Restricted)
then:
result.isSuccess()
result.get() == Result.Rejection
Expand All @@ -60,7 +60,7 @@ class AddBookToCatalogueTest extends Specification {
given:
databaseDoesNotWork()
when:
Try<Result> result = catalouge.addBook("Eric Evans", "DDD", DDD_ISBN_STR)
Try<Result> result = catalogue.addBook("Eric Evans", "DDD", DDD_ISBN_STR)
then:
result.isFailure()
}
Expand All @@ -71,7 +71,7 @@ class AddBookToCatalogueTest extends Specification {
and:
thereIsBookWith(DDD_ISBN_STR)
when:
Try<Result> result = catalouge.addBookInstance(DDD_ISBN_STR, Restricted)
Try<Result> result = catalogue.addBookInstance(DDD_ISBN_STR, Restricted)
then:
result.isFailure()
and:
Expand Down

0 comments on commit 455543d

Please sign in to comment.