You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.0 KiB
69 lines
2.0 KiB
//
|
|
// 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)
|
|
}
|
|
}
|
|
|
|
}
|