             invalidDictionary[key] = invalidValue
             
             do {
-                let _: UnboxTestMock = try UnboxOrThrow(invalidDictionary)
+                try UnboxOrThrow(invalidDictionary) as UnboxTestMock
                 XCTFail("Unbox should have thrown for an invalid value")
             } catch UnboxError.InvalidValue(key, invalidValueDescription) {
                 // Test passed

            invalidDictionary.removeValueForKey(key)
            
            do {
                let _: UnboxTestMock = try UnboxOrThrow(invalidDictionary)
                XCTFail("Unbox should have thrown for a missing value")
            } catch UnboxError.MissingKey(key) {
                // Test passed

    func testThrowingForInvalidData() {
        if let data = "Not a dictionary".dataUsingEncoding(NSUTF8StringEncoding) {
            do {
                try UnboxOrThrow(data) as UnboxTestMock
                XCTFail("Unbox should have thrown for invalid data")
            } catch UnboxError.InvalidData {
                // Test passed
