Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Commit

Permalink
Merge branch 'tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdias committed May 17, 2016
2 parents 3dfcb8b + 50f174f commit eb28069
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 1 deletion.
24 changes: 24 additions & 0 deletions IrisKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
A039780D1CE8B13F0042A1C4 /* FeedDetailTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A039780C1CE8B13F0042A1C4 /* FeedDetailTableViewController.swift */; };
A03978101CE8B1E10042A1C4 /* FeedTableViewController + ReusableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A039780E1CE8B1E10042A1C4 /* FeedTableViewController + ReusableCell.swift */; };
A03978111CE8B1E10042A1C4 /* FeedTableViewController + TableViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A039780F1CE8B1E10042A1C4 /* FeedTableViewController + TableViewLayout.swift */; };
A05C1F171CEBB47D0092D70E /* SyndicationTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F161CEBB47D0092D70E /* SyndicationTestCase.swift */; };
A05C1F181CEBB47D0092D70E /* SyndicationTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F161CEBB47D0092D70E /* SyndicationTestCase.swift */; };
A05C1F191CEBB47D0092D70E /* SyndicationTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F161CEBB47D0092D70E /* SyndicationTestCase.swift */; };
A05C1F1B1CEBB58A0092D70E /* ContentTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F1A1CEBB58A0092D70E /* ContentTestCase.swift */; };
A05C1F1C1CEBB58A0092D70E /* ContentTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F1A1CEBB58A0092D70E /* ContentTestCase.swift */; };
A05C1F1D1CEBB58A0092D70E /* ContentTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F1A1CEBB58A0092D70E /* ContentTestCase.swift */; };
A05C1F1F1CEBB6080092D70E /* FeedTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F1E1CEBB6080092D70E /* FeedTestCase.swift */; };
A05C1F201CEBB6080092D70E /* FeedTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F1E1CEBB6080092D70E /* FeedTestCase.swift */; };
A05C1F211CEBB6080092D70E /* FeedTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05C1F1E1CEBB6080092D70E /* FeedTestCase.swift */; };
A09C85031CE9AE2300D20CAB /* IrisKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0EF4E0C1CE86D1E00C52142 /* IrisKit.framework */; };
A09C85121CE9AE4F00D20CAB /* IrisKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0EF4DE81CE86C3800C52142 /* IrisKit.framework */; };
A09C85211CE9AE6A00D20CAB /* IrisKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0EF4DFA1CE86CA200C52142 /* IrisKit.framework */; };
Expand Down Expand Up @@ -205,6 +214,9 @@
A039780C1CE8B13F0042A1C4 /* FeedDetailTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FeedDetailTableViewController.swift; path = "View Controllers/FeedDetailTableViewController.swift"; sourceTree = "<group>"; };
A039780E1CE8B1E10042A1C4 /* FeedTableViewController + ReusableCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "FeedTableViewController + ReusableCell.swift"; path = "Extensions/FeedTableViewController + ReusableCell.swift"; sourceTree = "<group>"; };
A039780F1CE8B1E10042A1C4 /* FeedTableViewController + TableViewLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "FeedTableViewController + TableViewLayout.swift"; path = "Extensions/FeedTableViewController + TableViewLayout.swift"; sourceTree = "<group>"; };
A05C1F161CEBB47D0092D70E /* SyndicationTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyndicationTestCase.swift; sourceTree = "<group>"; };
A05C1F1A1CEBB58A0092D70E /* ContentTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentTestCase.swift; sourceTree = "<group>"; };
A05C1F1E1CEBB6080092D70E /* FeedTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedTestCase.swift; sourceTree = "<group>"; };
A09C84FE1CE9AE2300D20CAB /* IrisKit iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IrisKit iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
A09C850D1CE9AE4F00D20CAB /* IrisKit tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IrisKit tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
A09C851C1CE9AE6A00D20CAB /* IrisKit macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IrisKit macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -364,6 +376,9 @@
A09C852A1CE9B0C300D20CAB /* Info-tvOS.plist */,
A0D20C351CEB007100B4509D /* BaseTestCase.swift */,
A0D20C391CEB01E400B4509D /* DublinCoreTestCase.swift */,
A05C1F161CEBB47D0092D70E /* SyndicationTestCase.swift */,
A05C1F1A1CEBB58A0092D70E /* ContentTestCase.swift */,
A05C1F1E1CEBB6080092D70E /* FeedTestCase.swift */,
);
path = Tests;
sourceTree = "<group>";
Expand Down Expand Up @@ -850,7 +865,10 @@
buildActionMask = 2147483647;
files = (
A0D20C3A1CEB01E400B4509D /* DublinCoreTestCase.swift in Sources */,
A05C1F171CEBB47D0092D70E /* SyndicationTestCase.swift in Sources */,
A0D20C361CEB007100B4509D /* BaseTestCase.swift in Sources */,
A05C1F1F1CEBB6080092D70E /* FeedTestCase.swift in Sources */,
A05C1F1B1CEBB58A0092D70E /* ContentTestCase.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -859,7 +877,10 @@
buildActionMask = 2147483647;
files = (
A0D20C3B1CEB01E400B4509D /* DublinCoreTestCase.swift in Sources */,
A05C1F181CEBB47D0092D70E /* SyndicationTestCase.swift in Sources */,
A0D20C371CEB007100B4509D /* BaseTestCase.swift in Sources */,
A05C1F201CEBB6080092D70E /* FeedTestCase.swift in Sources */,
A05C1F1C1CEBB58A0092D70E /* ContentTestCase.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -868,7 +889,10 @@
buildActionMask = 2147483647;
files = (
A0D20C3C1CEB01E400B4509D /* DublinCoreTestCase.swift in Sources */,
A05C1F191CEBB47D0092D70E /* SyndicationTestCase.swift in Sources */,
A0D20C381CEB007100B4509D /* BaseTestCase.swift in Sources */,
A05C1F211CEBB6080092D70E /* FeedTestCase.swift in Sources */,
A05C1F1D1CEBB58A0092D70E /* ContentTestCase.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
71 changes: 71 additions & 0 deletions Tests/ContentTestCase.swift
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.
}
}

}
2 changes: 1 addition & 1 deletion Tests/DublinCoreTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import IrisKit

class DublinCoreTestCase: BaseTestCase {

func testDublinCoreModel() {
func testDublinCore() {

// Given
let URL = fileURL("DC", type: "xml")
Expand Down
Loading

0 comments on commit eb28069

Please sign in to comment.