NetNewsWire/Frameworks/Account/AccountTests/Feedly/FeedlyCollectionParserTests...

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)
}
}