File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed
Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,27 @@ import XCTest
44final class YouTubePlayerSourceTests : XCTestCase {
55
66 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+ )
1828 }
1929
2030}
You can’t perform that action at this time.
0 commit comments