     func testGetToneCustom() {
         let expectation = self.expectation(description: "Get tone with custom parameters.")
         toneAnalyzer.tone(
-            toneInput: ToneInput(text: text),
+            toneContent: .toneInput(ToneInput(text: text)),
             sentences: false,
             contentLanguage: "en",
-            acceptLanguage: "en",
-            failure: failWithError)
+            acceptLanguage: "en")
         {
-            toneAnalysis in
+            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)
             XCTAssertNil(toneAnalysis.sentencesTone)


    func testGetToneEmptyString() {
        let expectation = self.expectation(description: "Get tone with an empty string.")
        let failure = { (error: Error) in expectation.fulfill() }
        toneAnalyzer.tone(toneInput: ToneInput(text: ""), failure: failure, success: failWithResult)
        waitForExpectations()
    }

    func testToneChatEmptyArray() {
        let expectation = self.expectation(description: "Tone chat with an empty array.")
        let failure = { (error: Error) in expectation.fulfill() }
        toneAnalyzer.toneChat(utterances: [], acceptLanguage: "en", failure: failure, success: failWithResult)
        waitForExpectations()
    }
}


    func testGetTonePlainText() {
        let expectation = self.expectation(description: "Get tone.")
        toneAnalyzer.tone(toneContent: .text(text)) {
            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)
