     func testGetToneHTML() {
         let expectation = self.expectation(description: "Get tone.")
         let html = "<!DOCTYPE html><html><body><p>\(text)</p></body></html>"
-        toneAnalyzer.tone(html: html, failure: failWithError) {
-            toneAnalysis in
+        toneAnalyzer.tone(toneContent: .html(html)) {
+            response, error in
+            guard let toneAnalysis = response?.result else {
+                XCTFail("Positive test failed with error: \(error!)")
+                return
+            }
             XCTAssertNotNil(toneAnalysis.documentTone.tones)
             XCTAssertGreaterThan(toneAnalysis.documentTone.tones!.count, 0)
             XCTAssertNotNil(toneAnalysis.sentencesTone)

        toneAnalyzer.defaultHeaders["X-Watson-Test"] = "true"
    }

    /** Fail false negatives. */
    func failWithError(error: Error) {
        XCTFail("Positive test failed with error: \(error)")
    }

    /** Fail false positives. */
    func failWithResult<T>(result: T) {
        XCTFail("Negative test returned a result.")
    }

    /** Fail false positives. */
    func failWithResult() {
        XCTFail("Negative test returned a result.")
    }

    /** Wait for expectations. */
    func waitForExpectations(timeout: TimeInterval = 5.0) {
        waitForExpectations(timeout: timeout) { error in


    func testGetToneEmptyString() {
        let expectation = self.expectation(description: "Get tone with an empty string.")
        toneAnalyzer.tone(toneContent: .toneInput(ToneInput(text: ""))) {
            _, error in
            if error == nil {
                XCTFail("Negative test did not return error.")
            }
            expectation.fulfill()
        }
        waitForExpectations()
    }

    func testToneChatEmptyArray() {
        let expectation = self.expectation(description: "Tone chat with an empty array.")
        toneAnalyzer.toneChat(utterances: [], acceptLanguage: "en") {
            _, error in
            if error == nil {
                XCTFail("Negative test did not return error.")
            }
            expectation.fulfill()
        }
        waitForExpectations()
    }
}
