mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-24 16:51:19 +01:00
29 lines
914 B
Swift
29 lines
914 B
Swift
|
//
|
||
|
// FeedlyCollectionParserTests.swift
|
||
|
// AccountTests
|
||
|
//
|
||
|
// Created by Kiel Gillard on 29/1/20.
|
||
|
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import XCTest
|
||
|
@testable import Account
|
||
|
|
||
|
class FeedlyCollectionParserTests: XCTestCase {
|
||
|
|
||
|
func testParsing() {
|
||
|
let collection = FeedlyCollection(feeds: [], label: "Test Collection", id: "test/collection/1")
|
||
|
let parser = FeedlyCollectionParser(collection: collection)
|
||
|
XCTAssertEqual(parser.folderName, collection.label)
|
||
|
XCTAssertEqual(parser.externalID, collection.id)
|
||
|
}
|
||
|
|
||
|
func testSanitization() {
|
||
|
let name = "Test Collection"
|
||
|
let collection = FeedlyCollection(feeds: [], label: "<div style=\"direction:rtl;text-align:right\">\(name)</div>", id: "test/collection/1")
|
||
|
let parser = FeedlyCollectionParser(collection: collection)
|
||
|
XCTAssertEqual(parser.folderName, name)
|
||
|
XCTAssertEqual(parser.externalID, collection.id)
|
||
|
}
|
||
|
}
|