@@ -4,17 +4,27 @@ import XCTest
4
4
final class YouTubePlayerSourceTests : XCTestCase {
5
5
6
6
func testURLs( ) throws {
7
- let urls = [
8
- " https://youtube.com/watch?v=psL_5RIBqnY " ,
9
- " https://youtu.be/psL_5RIBqnY " ,
10
- " https://youtube.com/embed/psL_5RIBqnY " ,
11
- " https://youtube.com/c/iJustine " ,
12
- " https://youtube.com/user/iJustine " ,
13
- " https://youtube.com/v/0e6HWEy1ZRE "
14
- ]
15
- for url in urls {
16
- XCTAssertNotNil ( YouTubePlayer . Source. url ( url) )
17
- }
7
+ let testCandidate = UUID ( ) . uuidString
8
+ XCTAssertEqual (
9
+ YouTubePlayer . Source. url ( " https://youtube.com/watch?v= \( testCandidate) " ) ,
10
+ . video( id: testCandidate)
11
+ )
12
+ XCTAssertEqual (
13
+ YouTubePlayer . Source. url ( " https://youtu.be/ \( testCandidate) " ) ,
14
+ . video( id: testCandidate)
15
+ )
16
+ XCTAssertEqual (
17
+ YouTubePlayer . Source. url ( " https://youtube.com/_/ \( testCandidate) " ) ,
18
+ . video( id: testCandidate)
19
+ )
20
+ XCTAssertEqual (
21
+ YouTubePlayer . Source. url ( " https://youtube.com/c/ \( testCandidate) " ) ,
22
+ . channel( name: testCandidate)
23
+ )
24
+ XCTAssertEqual (
25
+ YouTubePlayer . Source. url ( " https://youtube.com/user/ \( testCandidate) " ) ,
26
+ . channel( name: testCandidate)
27
+ )
18
28
}
19
29
20
30
}
0 commit comments