This repository has been archived by the owner on Apr 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
326 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// | ||
// ContentTestCase.swift | ||
// IrisKit | ||
// | ||
// Created by Nuno Dias on 17/05/16. | ||
// | ||
// | ||
|
||
import XCTest | ||
import IrisKit | ||
|
||
class ContentTestCase: BaseTestCase { | ||
|
||
func testContent() { | ||
|
||
// Given | ||
let URL = fileURL("Content", type: "xml") | ||
let parser = IrisFeedParser(URL: URL) | ||
|
||
// When | ||
parser.parse { (feed) in | ||
|
||
// Then | ||
guard let channel = feed?.channel else { | ||
assert(false) | ||
} | ||
|
||
assert(channel.dcTitle == "title") | ||
assert(channel.dcCreator == "creator") | ||
assert(channel.dcSubject == "subject") | ||
assert(channel.dcDescription == "description") | ||
assert(channel.dcPublisher == "publisher") | ||
assert(channel.dcContributor == "contributor") | ||
assert(channel.dcDate == "date") | ||
assert(channel.dcType == "type") | ||
assert(channel.dcFormat == "format") | ||
assert(channel.dcIdentifier == "identifier") | ||
assert(channel.dcSource == "source") | ||
assert(channel.dcLanguage == "language") | ||
assert(channel.dcRelation == "relation") | ||
assert(channel.dcCoverage == "coverage") | ||
assert(channel.dcRights == "rights") | ||
|
||
assert(channel.items?.last?.dcTitle == "title") | ||
assert(channel.items?.last?.dcCreator == "creator") | ||
assert(channel.items?.last?.dcSubject == "subject") | ||
assert(channel.items?.last?.dcDescription == "description") | ||
assert(channel.items?.last?.dcPublisher == "publisher") | ||
assert(channel.items?.last?.dcContributor == "contributor") | ||
assert(channel.items?.last?.dcDate == "date") | ||
assert(channel.items?.last?.dcType == "type") | ||
assert(channel.items?.last?.dcFormat == "format") | ||
assert(channel.items?.last?.dcIdentifier == "identifier") | ||
assert(channel.items?.last?.dcSource == "source") | ||
assert(channel.items?.last?.dcLanguage == "language") | ||
assert(channel.items?.last?.dcRelation == "relation") | ||
assert(channel.items?.last?.dcCoverage == "coverage") | ||
assert(channel.items?.last?.dcRights == "rights") | ||
|
||
} | ||
|
||
} | ||
|
||
func testPerformanceExample() { | ||
// This is an example of a performance test case. | ||
self.measureBlock { | ||
// Put the code you want to measure the time of here. | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.