Skip to content

Instantly share code, notes, and snippets.

@SURYAKANTSHARMA
Created May 3, 2019 17:44
Show Gist options
  • Save SURYAKANTSHARMA/e41f3264c7fc14c4891b23a784cfd14e to your computer and use it in GitHub Desktop.
Save SURYAKANTSHARMA/e41f3264c7fc14c4891b23a784cfd14e to your computer and use it in GitHub Desktop.
testAppraisal
func testAppraisal() {
let user = User(name: "John", salary: 100.0)
let result = Appraisal(user: user, rating: PerformanceRating.exceedExpection).perform()
switch result {
case .bonus(let amount):
XCTAssertTrue(amount == 200.0)
default:
XCTFail("Appraisal Perform function is faulty")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment