Last active
December 15, 2015 19:30
-
-
Save fitomad/49e72a6bdfd2988a6a72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// Prueba de rendimiento para la operacion | |
/// de recuperacion de datos para una serie de TV | |
/// | |
func testShow() | |
{ | |
// Manhattan Love Story | |
let showID: Int = 281624 | |
// Closure de rendimiento | |
// Se ejecuta 10 veces | |
self.measureBlock() | |
{ | |
let expectation: XCTestExpectation = self.expectationWithDescription("Rendimiento de fanartForShow()") | |
FanartClient.sharedInstance.fanartForShow(showID) { (show, error) -> (Void) in | |
// Comprobamos errores en la llamadas | |
XCTAssertNil(error, "Se ha producido un error en el framework") | |
if let show = show | |
{ | |
print("# \(show.showName)") | |
} | |
else | |
{ | |
print("#El show no existe") | |
} | |
// Operacion asincrona terminada | |
expectation.fulfill() | |
} | |
// Esperamos a que la operacion termine | |
self.waitForExpectationsWithTimeout(10, handler: { (error: NSError?) -> Void in | |
if let error = error | |
{ | |
print("testError. \(error.localizedDescription)") | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment