// // kplayerTests.swift // kplayerTests // // Created by Marco Schmickler on 24.05.15. // Copyright (c) 2015 Marco Schmickler. All rights reserved. // import UIKit import XCTest import kplayer class kplayerTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testMyExample() { let hqURL = URL(string: "http://linkstation:8080/tomcat/media/service/download/srv/samba/ren/heg/emily/emily-amazing-10000px/emily-amazing-21-10000px.jpg")! let op = ImageLoadOperation(imageURL: hqURL, succeeder: { i in // println("image loaded \(newItem.imageUrlAbsolute) at \(photoAtIndex)") print(i) }, index: 1) op.main() print("hello") let i = 1 // This is an example of a functional test case. XCTAssert(i == 1, "Pass") } func testJson() { do { if let bundlePath = Bundle.main.path(forResource: "save", ofType: "json"), let jsonData = try String(contentsOfFile: bundlePath).data(using: .utf8) { let decodedData = try JSONDecoder().decode(MediaModel.self, from: jsonData) print(jsonData) } } catch { print(error) } } func testPerformanceExample() { // This is an example of a performance test case. self.measure() { let hqURL = URL(string: "http://linkstation:8080/tomcat/media/service/download/srv/samba/ren/heg/emily/emily-amazing-10000px/emily-amazing-21-10000px.jpg")! let data = try? Data(contentsOf: hqURL) print(data) } } }