From bed17007bc78450e310678d821798fc6e7acd6b3 Mon Sep 17 00:00:00 2001 From: Philip Niedertscheider Date: Sat, 10 Oct 2026 12:45:20 +0200 Subject: [PATCH] test(pagination): Migrate specs to Swift Testing --- .../Pagination/Int+RomanNumerals_Spec.swift | 103 ---------------- .../Pagination/IntRomanNumeralsTests.swift | 97 +++++++++++++++ .../PDFPaginationEquatableTests.swift | 31 +++++ .../PDFPaginationStyle+Equatable_Spec.swift | 87 ------------- .../PDFPaginationStyleEquatableTests.swift | 75 ++++++++++++ .../Pagination/PDFPaginationStyleTests.swift | 115 ++++++++++++++++++ .../Pagination/PDFPaginationStyle_Spec.swift | 101 --------------- .../Pagination/PDFPaginationTests.swift | 27 ++++ .../PDFPagination_Closure_Spec.swift | 26 ---- .../PDFPagination_Equatable_Spec.swift | 40 ------ .../Pagination/PDFPagination_Spec.swift | 42 ------- 11 files changed, 345 insertions(+), 399 deletions(-) delete mode 100644 Tests/TPPDFTests/Pagination/Int+RomanNumerals_Spec.swift create mode 100644 Tests/TPPDFTests/Pagination/IntRomanNumeralsTests.swift create mode 100644 Tests/TPPDFTests/Pagination/PDFPaginationEquatableTests.swift delete mode 100644 Tests/TPPDFTests/Pagination/PDFPaginationStyle+Equatable_Spec.swift create mode 100644 Tests/TPPDFTests/Pagination/PDFPaginationStyleEquatableTests.swift create mode 100644 Tests/TPPDFTests/Pagination/PDFPaginationStyleTests.swift delete mode 100644 Tests/TPPDFTests/Pagination/PDFPaginationStyle_Spec.swift create mode 100644 Tests/TPPDFTests/Pagination/PDFPaginationTests.swift delete mode 100644 Tests/TPPDFTests/Pagination/PDFPagination_Closure_Spec.swift delete mode 100644 Tests/TPPDFTests/Pagination/PDFPagination_Equatable_Spec.swift delete mode 100644 Tests/TPPDFTests/Pagination/PDFPagination_Spec.swift diff --git a/Tests/TPPDFTests/Pagination/Int+RomanNumerals_Spec.swift b/Tests/TPPDFTests/Pagination/Int+RomanNumerals_Spec.swift deleted file mode 100644 index e6bb9b49..00000000 --- a/Tests/TPPDFTests/Pagination/Int+RomanNumerals_Spec.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// Int+RomanNumerals_Spec.swift -// TPPDF -// -// Created by Philip Niedertscheider on 11.09.2017. -// Copyright © 2016-2026 techprimate GmbH. All rights reserved. -// - -import Nimble -import Quick -@testable import TPPDF - -class Int_RomanNUmerals_Spec: QuickSpec { - // swiftlint:disable closure_body_length function_body_length - override func spec() { - describe("Int") { - describe("RomanNumerals") { - it("can convert itself into a roman numeral") { - expect(0.romanNumerals) == "" // swiftlint:disable:this empty_string - expect(1.romanNumerals) == "I" - expect(2.romanNumerals) == "II" - expect(3.romanNumerals) == "III" - expect(4.romanNumerals) == "IV" - expect(5.romanNumerals) == "V" - expect(6.romanNumerals) == "VI" - expect(7.romanNumerals) == "VII" - expect(8.romanNumerals) == "VIII" - expect(9.romanNumerals) == "IX" - - expect(10.romanNumerals) == "X" - expect(11.romanNumerals) == "XI" - expect(12.romanNumerals) == "XII" - expect(13.romanNumerals) == "XIII" - expect(14.romanNumerals) == "XIV" - expect(15.romanNumerals) == "XV" - expect(16.romanNumerals) == "XVI" - expect(17.romanNumerals) == "XVII" - expect(18.romanNumerals) == "XVIII" - expect(19.romanNumerals) == "XIX" - - expect(20.romanNumerals) == "XX" - expect(21.romanNumerals) == "XXI" - expect(22.romanNumerals) == "XXII" - expect(23.romanNumerals) == "XXIII" - expect(24.romanNumerals) == "XXIV" - expect(25.romanNumerals) == "XXV" - expect(26.romanNumerals) == "XXVI" - expect(27.romanNumerals) == "XXVII" - expect(28.romanNumerals) == "XXVIII" - expect(29.romanNumerals) == "XXIX" - expect(30.romanNumerals) == "XXX" - - expect(40.romanNumerals) == "XL" - expect(41.romanNumerals) == "XLI" - expect(42.romanNumerals) == "XLII" - expect(43.romanNumerals) == "XLIII" - expect(44.romanNumerals) == "XLIV" - expect(45.romanNumerals) == "XLV" - expect(46.romanNumerals) == "XLVI" - expect(47.romanNumerals) == "XLVII" - expect(48.romanNumerals) == "XLVIII" - expect(49.romanNumerals) == "XLIX" - expect(50.romanNumerals) == "L" - - expect(51.romanNumerals) == "LI" - expect(52.romanNumerals) == "LII" - expect(53.romanNumerals) == "LIII" - expect(54.romanNumerals) == "LIV" - expect(55.romanNumerals) == "LV" - expect(56.romanNumerals) == "LVI" - expect(57.romanNumerals) == "LVII" - expect(58.romanNumerals) == "LVIII" - expect(59.romanNumerals) == "LIX" - expect(60.romanNumerals) == "LX" - - expect(90.romanNumerals) == "XC" - expect(91.romanNumerals) == "XCI" - expect(92.romanNumerals) == "XCII" - expect(93.romanNumerals) == "XCIII" - expect(94.romanNumerals) == "XCIV" - expect(95.romanNumerals) == "XCV" - expect(96.romanNumerals) == "XCVI" - expect(97.romanNumerals) == "XCVII" - expect(98.romanNumerals) == "XCVIII" - expect(99.romanNumerals) == "XCIX" - - expect(100.romanNumerals) == "C" - expect(200.romanNumerals) == "CC" - expect(300.romanNumerals) == "CCC" - expect(400.romanNumerals) == "CD" - expect(500.romanNumerals) == "D" - - expect(600.romanNumerals) == "DC" - expect(700.romanNumerals) == "DCC" - expect(800.romanNumerals) == "DCCC" - expect(900.romanNumerals) == "CM" - expect(1000.romanNumerals) == "M" - } - } - } - } - // swiftlint:enable closure_body_length function_body_length -} diff --git a/Tests/TPPDFTests/Pagination/IntRomanNumeralsTests.swift b/Tests/TPPDFTests/Pagination/IntRomanNumeralsTests.swift new file mode 100644 index 00000000..5d2c69f0 --- /dev/null +++ b/Tests/TPPDFTests/Pagination/IntRomanNumeralsTests.swift @@ -0,0 +1,97 @@ +// +// IntRomanNumeralsTests.swift +// TPPDF +// +// Created by Philip Niedertscheider on 11.09.2017. +// Copyright © 2016-2026 techprimate GmbH. All rights reserved. +// + +import Testing +@testable import TPPDF + +struct IntRomanNumeralsTests { + @Test(arguments: [ + (0, ""), + (1, "I"), + (2, "II"), + (3, "III"), + (4, "IV"), + (5, "V"), + (6, "VI"), + (7, "VII"), + (8, "VIII"), + (9, "IX"), + (10, "X"), + (11, "XI"), + (12, "XII"), + (13, "XIII"), + (14, "XIV"), + (15, "XV"), + (16, "XVI"), + (17, "XVII"), + (18, "XVIII"), + (19, "XIX"), + (20, "XX"), + (21, "XXI"), + (22, "XXII"), + (23, "XXIII"), + (24, "XXIV"), + (25, "XXV"), + (26, "XXVI"), + (27, "XXVII"), + (28, "XXVIII"), + (29, "XXIX"), + (30, "XXX"), + (40, "XL"), + (41, "XLI"), + (42, "XLII"), + (43, "XLIII"), + (44, "XLIV"), + (45, "XLV"), + (46, "XLVI"), + (47, "XLVII"), + (48, "XLVIII"), + (49, "XLIX"), + (50, "L"), + (51, "LI"), + (52, "LII"), + (53, "LIII"), + (54, "LIV"), + (55, "LV"), + (56, "LVI"), + (57, "LVII"), + (58, "LVIII"), + (59, "LIX"), + (60, "LX"), + (90, "XC"), + (91, "XCI"), + (92, "XCII"), + (93, "XCIII"), + (94, "XCIV"), + (95, "XCV"), + (96, "XCVI"), + (97, "XCVII"), + (98, "XCVIII"), + (99, "XCIX"), + (100, "C"), + (200, "CC"), + (300, "CCC"), + (400, "CD"), + (500, "D"), + (600, "DC"), + (700, "DCC"), + (800, "DCCC"), + (900, "CM"), + (1000, "M"), + ]) + func convertsIntegersToRomanNumerals(value: Int, expectedNumeral: String) { + // Arrange + let number = value + + // Act + let numeral = number.romanNumerals + + // Assert + #expect(numeral == expectedNumeral) + } +} diff --git a/Tests/TPPDFTests/Pagination/PDFPaginationEquatableTests.swift b/Tests/TPPDFTests/Pagination/PDFPaginationEquatableTests.swift new file mode 100644 index 00000000..d61f1d62 --- /dev/null +++ b/Tests/TPPDFTests/Pagination/PDFPaginationEquatableTests.swift @@ -0,0 +1,31 @@ +// +// PDFPaginationEquatableTests.swift +// TPPDF +// +// Created by Philip Niedertscheider on 11.04.2017. +// Copyright © 2016-2026 techprimate GmbH. All rights reserved. +// + +import Testing +@testable import TPPDF + +struct PDFPaginationEquatableTests { + @Test(arguments: ["container", "style", "range", "hiddenPages"]) + func differingSettingsMakePaginationUnequal(property: String) { + // Arrange + let pagination = PDFPagination() + var otherPagination = PDFPagination() + switch property { + case "container": otherPagination.container = .contentLeft + case "style": otherPagination.style = .roman(template: "%@ / %@") + case "range": otherPagination.range = (start: 2, end: 5) + default: otherPagination.hiddenPages = [1, 2, 3] + } + + // Act + let isEqual = pagination == otherPagination + + // Assert + #expect(!isEqual) + } +} diff --git a/Tests/TPPDFTests/Pagination/PDFPaginationStyle+Equatable_Spec.swift b/Tests/TPPDFTests/Pagination/PDFPaginationStyle+Equatable_Spec.swift deleted file mode 100644 index d41deccc..00000000 --- a/Tests/TPPDFTests/Pagination/PDFPaginationStyle+Equatable_Spec.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// PDFPaginationStyle+Equatable_Spec.swift -// TPPDF -// -// Created by Philip Niedertscheider on 27.12.2017. -// Copyright © 2016-2026 techprimate GmbH. All rights reserved. -// - -import Foundation -import Nimble -import Quick -@testable import TPPDF - -class PDFPaginationStyle_Equatable_Spec: QuickSpec { - // swiftlint:disable closure_body_length function_body_length - override func spec() { - describe("PDFPaginationStyle") { - context("Equatable") { - it("is equal when both default") { - let lhsPagination = PDFPaginationStyle.default - let rhsPagination = PDFPaginationStyle.default - - expect(lhsPagination) == rhsPagination - } - - it("is not equal with different roman template") { - let firstPagination = PDFPaginationStyle.roman(template: "123") - let secondPagination = PDFPaginationStyle.roman(template: "123") - let thirdPagination = PDFPaginationStyle.roman(template: "456") - - expect(firstPagination) == firstPagination - expect(firstPagination) == secondPagination - expect(firstPagination) != thirdPagination - expect(secondPagination) != thirdPagination - } - - it("is not equal with different custom number formatter") { - let firstFormatter = NumberFormatter() - firstFormatter.numberStyle = NumberFormatter.Style.percent - - let secondFormatter = NumberFormatter() - secondFormatter.numberStyle = NumberFormatter.Style.decimal - - let firstTemplate = "123" - let secondTemplate = "456" - - let paginations = [ - PDFPaginationStyle.customNumberFormat(template: firstTemplate, formatter: firstFormatter), - PDFPaginationStyle.customNumberFormat(template: firstTemplate, formatter: secondFormatter), - - PDFPaginationStyle.customNumberFormat(template: secondTemplate, formatter: firstFormatter), - PDFPaginationStyle.customNumberFormat(template: secondTemplate, formatter: secondFormatter), - ] - - expect(paginations[0]) == paginations[0] - expect(paginations[0]) != paginations[1] - expect(paginations[0]) != paginations[2] - expect(paginations[0]) != paginations[3] - - expect(paginations[1]) != paginations[0] - expect(paginations[1]) == paginations[1] - expect(paginations[1]) != paginations[2] - expect(paginations[1]) != paginations[3] - - expect(paginations[2]) != paginations[0] - expect(paginations[2]) != paginations[1] - expect(paginations[2]) == paginations[2] - expect(paginations[2]) != paginations[3] - - expect(paginations[3]) != paginations[0] - expect(paginations[3]) != paginations[1] - expect(paginations[3]) != paginations[2] - expect(paginations[3]) == paginations[3] - } - - it("is never equal with custom closure") { - let pagination = PDFPaginationStyle.customClosure { _, _ -> String in - "" - } - expect(pagination) != pagination - expect(pagination.format(page: 1, total: 2)) == "" // swiftlint:disable:this empty_string - } - } - } - } - // swiftlint:enable closure_body_length function_body_length -} diff --git a/Tests/TPPDFTests/Pagination/PDFPaginationStyleEquatableTests.swift b/Tests/TPPDFTests/Pagination/PDFPaginationStyleEquatableTests.swift new file mode 100644 index 00000000..f576650b --- /dev/null +++ b/Tests/TPPDFTests/Pagination/PDFPaginationStyleEquatableTests.swift @@ -0,0 +1,75 @@ +// +// PDFPaginationStyleEquatableTests.swift +// TPPDF +// +// Created by Philip Niedertscheider on 27.12.2017. +// Copyright © 2016-2026 techprimate GmbH. All rights reserved. +// + +import Foundation +import Testing +@testable import TPPDF + +struct PDFPaginationStyleEquatableTests { + @Test func defaultStylesAreEqual() { + // Arrange + let style = PDFPaginationStyle.default + let otherStyle = PDFPaginationStyle.default + + // Act + let isEqual = style == otherStyle + + // Assert + #expect(isEqual) + } + + @Test(arguments: [(0, 0, true), (0, 1, true), (0, 2, false), (1, 2, false)]) + func romanStyleEqualityDependsOnTemplate(firstIndex: Int, secondIndex: Int, expectedEquality: Bool) { + // Arrange + let styles = [ + PDFPaginationStyle.roman(template: "123"), + .roman(template: "123"), + .roman(template: "456"), + ] + + // Act + let isEqual = styles[firstIndex] == styles[secondIndex] + + // Assert + #expect(isEqual == expectedEquality) + } + + @Test(arguments: [0, 1, 2, 3], [0, 1, 2, 3]) + func numberStyleEqualityDependsOnTemplateAndFormatter(firstIndex: Int, secondIndex: Int) { + // Arrange + let firstFormatter = NumberFormatter() + firstFormatter.numberStyle = .percent + let secondFormatter = NumberFormatter() + secondFormatter.numberStyle = .decimal + let styles = [ + PDFPaginationStyle.customNumberFormat(template: "123", formatter: firstFormatter), + .customNumberFormat(template: "123", formatter: secondFormatter), + .customNumberFormat(template: "456", formatter: firstFormatter), + .customNumberFormat(template: "456", formatter: secondFormatter), + ] + + // Act + let isEqual = styles[firstIndex] == styles[secondIndex] + + // Assert + #expect(isEqual == (firstIndex == secondIndex)) + } + + @Test func customClosureStyleIsNotEqualToItselfAndCanReturnEmptyText() { + // Arrange + let style = PDFPaginationStyle.customClosure { _, _ in "" } + + // Act + let isEqual = style == style + let text = style.format(page: 1, total: 2) + + // Assert + #expect(!isEqual) + #expect(text.isEmpty) + } +} diff --git a/Tests/TPPDFTests/Pagination/PDFPaginationStyleTests.swift b/Tests/TPPDFTests/Pagination/PDFPaginationStyleTests.swift new file mode 100644 index 00000000..6942e00f --- /dev/null +++ b/Tests/TPPDFTests/Pagination/PDFPaginationStyleTests.swift @@ -0,0 +1,115 @@ +// +// PDFPaginationStyleTests.swift +// TPPDF +// +// Created by Philip Niedertscheider on 11.04.2017. +// Copyright © 2016-2026 techprimate GmbH. All rights reserved. +// + +import Foundation +import Testing +@testable import TPPDF + +struct PDFPaginationStyleTests { + @Test func defaultStyleFormatsPageAndTotal() { + // Arrange + let style = PDFPaginationStyle.default + + // Act + let text = style.format(page: 2, total: 7) + + // Assert + #expect(text == "2 - 7") + } + + @Test func romanStyleFormatsPageAndTotalUsingTemplate() { + // Arrange + let style = PDFPaginationStyle.roman(template: "%@ / %@") + + // Act + let text = style.format(page: 2, total: 7) + + // Assert + #expect(text == "II / VII") + } + + @Test func customNumberStyleUsesFormatterAndTemplate() throws { + // Arrange + let formatter = NumberFormatter() + formatter.minimumFractionDigits = 2 + let separator = try #require(Locale.current.decimalSeparator) + let style = PDFPaginationStyle.customNumberFormat(template: "%@ +++ %@", formatter: formatter) + + // Act + let text = style.format(page: 2, total: 7) + + // Assert + #expect(text == "2\(separator)00 +++ 7\(separator)00") + } + + @Test func customClosureFormatsPageAndTotal() { + // Arrange + let style = PDFPaginationStyle.customClosure { page, total in + String(format: "%i - %i", page * page, 2 * total) + } + + // Act + let text = style.format(page: 3, total: 7) + + // Assert + #expect(text == "9 - 14") + } + + @Test func defaultStylesAreEqual() { + // Arrange + let style = PDFPaginationStyle.default + let otherStyle = PDFPaginationStyle.default + + // Act + let isEqual = style == otherStyle + + // Assert + #expect(isEqual) + } + + @Test(arguments: [("%@ - %@", true), ("%@ / %@", false)]) + func romanStyleEqualityDependsOnTemplate(otherTemplate: String, expectedEquality: Bool) { + // Arrange + let style = PDFPaginationStyle.roman(template: "%@ - %@") + let otherStyle = PDFPaginationStyle.roman(template: otherTemplate) + + // Act + let isEqual = style == otherStyle + + // Assert + #expect(isEqual == expectedEquality) + } + + @Test(arguments: [true, false], [true, false]) + func customNumberStyleEqualityRequiresSameTemplateAndFormatter(sameTemplate: Bool, sameFormatter: Bool) { + // Arrange + let formatter = NumberFormatter() + let otherFormatter = sameFormatter ? formatter : NumberFormatter() + let otherTemplate = sameTemplate ? "%@ - %@" : "%@ / %@" + let style = PDFPaginationStyle.customNumberFormat(template: "%@ - %@", formatter: formatter) + let otherStyle = PDFPaginationStyle.customNumberFormat(template: otherTemplate, formatter: otherFormatter) + + // Act + let isEqual = style == otherStyle + + // Assert + #expect(isEqual == (sameTemplate && sameFormatter)) + } + + @Test func customClosureStylesAreUnequalEvenWithSameFormatting() { + // Arrange + let style = PDFPaginationStyle.customClosure { page, total in "\(page) \(total)" } + let otherStyle = PDFPaginationStyle.customClosure { page, total in "\(page) \(total)" } + + // Act + let isEqual = style == otherStyle + + // Assert + #expect(!isEqual) + } +} diff --git a/Tests/TPPDFTests/Pagination/PDFPaginationStyle_Spec.swift b/Tests/TPPDFTests/Pagination/PDFPaginationStyle_Spec.swift deleted file mode 100644 index 8b060676..00000000 --- a/Tests/TPPDFTests/Pagination/PDFPaginationStyle_Spec.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// PDFPaginationStyle_Spec.swift -// TPPDF -// -// Created by Philip Niedertscheider on 11.04.2017. -// Copyright © 2016-2026 techprimate GmbH. All rights reserved. -// - -import Foundation -import Nimble -import Quick -@testable import TPPDF - -class PDFPaginationStyle_Spec: QuickSpec { - // swiftlint:disable closure_body_length function_body_length - override func spec() { - describe("PDFPagiationStyle") { - context("default") { - let style = PDFPaginationStyle.default - - it("can format a page number") { - expect(style.format(page: 2, total: 7)) == "2 - 7" - } - } - - context("roman") { - let style = PDFPaginationStyle.roman(template: "%@ / %@") - - it("can format a page number") { - expect(style.format(page: 2, total: 7)) == "II / VII" - } - } - - context("customNumberFormat") { - let formatter = NumberFormatter() - formatter.minimumFractionDigits = 2 - - let style = PDFPaginationStyle.customNumberFormat(template: "%@ +++ %@", formatter: formatter) - - it("can format a page number") { - let ds = Locale.current.decimalSeparator! - expect(style.format(page: 2, total: 7)) == "2\(ds)00 +++ 7\(ds)00" - } - } - - context("customClosure") { - let style = PDFPaginationStyle.customClosure { page, total -> String in - String(format: "%i - %i", page * page, 2 * total) - } - - it("can format a page number") { - expect(style.format(page: 3, total: 7)) == "9 - 14" - } - } - - context("equatable") { - it("can be equated when default") { - expect(PDFPaginationStyle.default == PDFPaginationStyle.default).to(beTrue()) - } - - it("can be equated when default") { - expect(PDFPaginationStyle.roman(template: "%@ - %@") == PDFPaginationStyle.roman(template: "%@ - %@")).to(beTrue()) - expect(PDFPaginationStyle.roman(template: "%@ - %@") == PDFPaginationStyle.roman(template: "%@ / %@")).to(beFalse()) - } - - it("can be equated when default") { - let numberFormatter1 = NumberFormatter() - let numberFormatter2 = NumberFormatter() - let template1 = "%@ - %@" - let template2 = "%@ / %@" - - expect( - PDFPaginationStyle.customNumberFormat(template: template1, formatter: numberFormatter1) == - PDFPaginationStyle.customNumberFormat(template: template1, formatter: numberFormatter1) - ).to(beTrue()) - expect( - PDFPaginationStyle.customNumberFormat(template: template1, formatter: numberFormatter1) == - PDFPaginationStyle.customNumberFormat(template: template1, formatter: numberFormatter2) - ).to(beFalse()) - expect( - PDFPaginationStyle.customNumberFormat(template: template1, formatter: numberFormatter1) == - PDFPaginationStyle.customNumberFormat(template: template2, formatter: numberFormatter1) - ).to(beFalse()) - expect( - PDFPaginationStyle.customNumberFormat(template: template1, formatter: numberFormatter1) == - PDFPaginationStyle.customNumberFormat(template: template2, formatter: numberFormatter2) - ).to(beFalse()) - } - - it("can be equated when default") { - expect(PDFPaginationStyle.customClosure { page, total -> String in - String(format: "%@ %@", page, total) - } == PDFPaginationStyle.customClosure { page, total -> String in - String(format: "%@ %@", page, total) - }).to(beFalse()) - } - } - } - } - // swiftlint:enable closure_body_length function_body_length -} diff --git a/Tests/TPPDFTests/Pagination/PDFPaginationTests.swift b/Tests/TPPDFTests/Pagination/PDFPaginationTests.swift new file mode 100644 index 00000000..d978babc --- /dev/null +++ b/Tests/TPPDFTests/Pagination/PDFPaginationTests.swift @@ -0,0 +1,27 @@ +// +// PDFPaginationTests.swift +// TPPDF +// +// Created by Philip Niedertscheider on 11.04.2017. +// Copyright © 2016-2026 techprimate GmbH. All rights reserved. +// + +import Testing +@testable import TPPDF + +struct PDFPaginationTests { + @Test func initializesWithDefaultPaginationSettings() { + // Arrange + let expectedRange = (start: 0, end: Int.max) + + // Act + let pagination = PDFPagination() + + // Assert + #expect(pagination.container == .none) + #expect(pagination.style == .default) + #expect(pagination.range.start == expectedRange.start) + #expect(pagination.range.end == expectedRange.end) + #expect(pagination.hiddenPages.isEmpty) + } +} diff --git a/Tests/TPPDFTests/Pagination/PDFPagination_Closure_Spec.swift b/Tests/TPPDFTests/Pagination/PDFPagination_Closure_Spec.swift deleted file mode 100644 index a9284a3f..00000000 --- a/Tests/TPPDFTests/Pagination/PDFPagination_Closure_Spec.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// PDFPagination_Closure_Spec.swift -// TPPDF -// -// Created by Philip Niedertscheider on 11.09.2017. -// Copyright © 2016-2026 techprimate GmbH. All rights reserved. -// - -import Nimble -import Quick -@testable import TPPDF - -class PDFPagination_Closure_Spec: QuickSpec { - override func spec() { - describe("PDFPagination") { - context("Closure") { - it("should have a closure typealias") { - // TODO: complete this -// let closure: PDFPaginationClosure = { (page: Int, total: Int) -> String in -// return "" -// } - } - } - } - } -} diff --git a/Tests/TPPDFTests/Pagination/PDFPagination_Equatable_Spec.swift b/Tests/TPPDFTests/Pagination/PDFPagination_Equatable_Spec.swift deleted file mode 100644 index 8e7942e3..00000000 --- a/Tests/TPPDFTests/Pagination/PDFPagination_Equatable_Spec.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// PDFPagination_Equatable_Spec.swift -// TPPDF -// -// Created by Philip Niedertscheider on 11.04.2017. -// Copyright © 2016-2026 techprimate GmbH. All rights reserved. -// - -import Nimble -import Quick -@testable import TPPDF - -class PDFPagination_Equatable_Spec: QuickSpec { - override func spec() { - describe("PDFPagination") { - context("Equatable") { - it("can be equated") { - let pagination = PDFPagination() - - var pagination1 = PDFPagination() - pagination1.container = PDFContainer.contentLeft - - var pagination2 = PDFPagination() - pagination2.style = PDFPaginationStyle.roman(template: "%@ / %@") - - var pagination3 = PDFPagination() - pagination3.range = (start: 2, end: 5) - - var pagination4 = PDFPagination() - pagination4.hiddenPages = [1, 2, 3] - - expect(pagination1) != pagination - expect(pagination2) != pagination - expect(pagination3) != pagination - expect(pagination4) != pagination - } - } - } - } -} diff --git a/Tests/TPPDFTests/Pagination/PDFPagination_Spec.swift b/Tests/TPPDFTests/Pagination/PDFPagination_Spec.swift deleted file mode 100644 index bce8531b..00000000 --- a/Tests/TPPDFTests/Pagination/PDFPagination_Spec.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// PDFPagination_Spec.swift -// TPPDF -// -// Created by Philip Niedertscheider on 11.04.2017. -// Copyright © 2016-2026 techprimate GmbH. All rights reserved. -// - -import Nimble -import Quick -@testable import TPPDF - -class PDFPagination_Spec: QuickSpec { - override func spec() { - describe("PDFPagination") { - var pagination: PDFPagination! - - beforeEach { - pagination = PDFPagination() - } - - context("default variables") { - it("should have a default container") { - expect(pagination.container) == PDFContainer.none - } - - it("should have a default style") { - expect(pagination.style) == PDFPaginationStyle.default - } - - it("should have a default range") { - expect(pagination.range.start) == 0 - expect(pagination.range.end) == Int.max - } - - it("should not have any default hidden pages") { - expect(pagination.hiddenPages) == [] - } - } - } - } -}