Skip to content

Commit

Permalink
Fix assertions in ExceptionExercisesTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Tya Cao committed Apr 30, 2018
1 parent a07a38a commit a97d8ae
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ class ExceptionExercisesTest extends FunSpec with TypeCheckedTripleEquals {
describe("createPerson") {

it("should return Person if supplied a valid name and age") {
assert(createPerson("Fred", "32") === Person("Fred", 20))
assert(createPerson("Fred", "32") === Person("Fred", 32))
}

it("should throw an EmptyNameException if the name supplied is empty") {
val caught = intercept[EmptyNameException] {
createPerson("", "32")
}

assert(caught.getMessage === "provided age is invalid: Fred")
assert(caught.getMessage === "provided name is empty")
}

it("should throw an InvalidAgeValueException if the age supplied is not an Int") {
val caught = intercept[InvalidAgeRangeException] {
val caught = intercept[InvalidAgeValueException] {
createPerson("Fred", "ThirtyTwo")
}

Expand Down

0 comments on commit a97d8ae

Please sign in to comment.