From 512338a3ce8e332cabe85fbec619b73ca1829c50 Mon Sep 17 00:00:00 2001 From: EdgSgroi Date: Fri, 4 Dec 2020 03:14:05 -0300 Subject: [PATCH 1/2] Change tests using Quick and Nimble --- Package.resolved | 43 ++ Package.swift | 4 +- .../Validators/FWRegexValidator.swift | 3 + .../JSON Decoder/FWJSONTests.swift | 120 +++--- .../Property Wrappers/ManualLayoutTests.swift | 27 +- .../Validators/FWRegexValidatorTests.swift | 385 +++++++++--------- .../ViewModels/FWFormViewModelTests.swift | 61 +-- 7 files changed, 346 insertions(+), 297 deletions(-) create mode 100644 Package.resolved diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 00000000..0aa1493d --- /dev/null +++ b/Package.resolved @@ -0,0 +1,43 @@ +{ + "object": { + "pins": [ + { + "package": "CwlCatchException", + "repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git", + "state": { + "branch": null, + "revision": "f809deb30dc5c9d9b78c872e553261a61177721a", + "version": "2.0.0" + } + }, + { + "package": "CwlPreconditionTesting", + "repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git", + "state": { + "branch": null, + "revision": "02b7a39a99c4da27abe03cab2053a9034379639f", + "version": "2.0.0" + } + }, + { + "package": "Nimble", + "repositoryURL": "https://github.com/Quick/Nimble.git", + "state": { + "branch": null, + "revision": "e491a6731307bb23783bf664d003be9b2fa59ab5", + "version": "9.0.0" + } + }, + { + "package": "Quick", + "repositoryURL": "https://github.com/Quick/Quick.git", + "state": { + "branch": null, + "revision": "0038bcbab4292f3b028632556507c124e5ba69f3", + "version": "3.0.0" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift index c070663d..dc2bc56d 100644 --- a/Package.swift +++ b/Package.swift @@ -17,6 +17,8 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), + .package(url: "https://github.com/Quick/Nimble.git", .upToNextMajor(from: "9.0.0")), + .package(url: "https://github.com/Quick/Quick.git", .upToNextMajor(from: "3.0.0")) ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -26,6 +28,6 @@ let package = Package( dependencies: []), .testTarget( name: "FormworksTests", - dependencies: ["Formworks"]), + dependencies: ["Formworks", "Quick", "Nimble"]), ] ) diff --git a/Sources/Formworks/Validators/FWRegexValidator.swift b/Sources/Formworks/Validators/FWRegexValidator.swift index 9a742962..8fbad254 100644 --- a/Sources/Formworks/Validators/FWRegexValidator.swift +++ b/Sources/Formworks/Validators/FWRegexValidator.swift @@ -20,6 +20,8 @@ enum FWRegex: String { Regex rule: '\(?\b([0-9]{2,3}|0((x|[0-9]){2,3}[0-9]{2}))\)?\s*[0-9]{4,5}[- ]*[0-9]{4}\b'. ## Phone Formats ## + - 0012345678 + - 00123456789 - 00 1234 1234 - 00 12345 1234 - (00)1234-1234 @@ -32,6 +34,7 @@ enum FWRegex: String { - (00) 123456789 - (000)1234 1234 - (000)12345 1234 + - 0000123456789 */ case phonenumber = #"\(?\b([0-9]{2,3}|0((x|[0-9]){2,3}[0-9]{2}))\)?\s*[0-9]{4,5}[- ]*[0-9]{4}\b"# /// Matches strings with a maximum of 32 characters. diff --git a/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift b/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift index 4c0e6d80..c270761c 100644 --- a/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift +++ b/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift @@ -6,76 +6,72 @@ // import XCTest +import Quick +import Nimble @testable import Formworks -final class FWJSONTests: XCTestCase { - var sut: FWJSON! - - override func tearDown() { - super.tearDown() - sut = nil - } - - func testEmptyData() { - sut = FWJSON(data: TestFixtures.emptyFormData) - sut.decode { (result: Result) in - switch result { - case .success: - XCTFail("InvaldidData: Form successefully decoded.") - case .failure(let error): - XCTAssertNotNil(error, "InvaldidData: Form error nil") +final class FWJSONSpec: QuickSpec { + override func spec() { + var sut: FWJSON! + + describe("the data") { + it("is empty") { + sut = FWJSON(data: TestFixtures.emptyFormData) + sut.decode { (result: Result) in + switch result { + case .success: + fail("InvaldidData: Form successefully decoded.") + case .failure(_): + break + } + } } - } - } - - func testBadComponentData() { - sut = FWJSON(data: TestFixtures.badComponentData) - sut.decode { (result: Result) in - switch result { - case .success: - XCTFail("InvaldidData: Component successefully decoded.") - case .failure(let error): - XCTAssertNotNil(error, "InvaldidData: Component error nil") + + it("has bad component") { + sut = FWJSON(data: TestFixtures.badComponentData) + sut.decode { (result: Result) in + switch result { + case .success: + fail("InvaldidData: Component successefully decoded.") + case .failure(_): + break + } + } } - } - } - - func testDecodeForm() { - sut = FWJSON(data: TestFixtures.formData) - sut.decode { (result: Result) in - switch result { - case .success(let form): - let errorMessage = "Form does not match it's decoded format" - XCTAssertEqual(form.title, TestFixtures.form.title, errorMessage) - XCTAssertEqual(form.components.count, TestFixtures.form.components.count, errorMessage) - XCTAssertEqual(form.id, TestFixtures.form.id, errorMessage) - XCTAssertEqual(form.responseFormat, TestFixtures.form.responseFormat, errorMessage) - XCTAssertEqual(form.style, TestFixtures.form.style, errorMessage) - case .failure(let error): - XCTAssertNil(error, "Error decoding form: \(error.localizedDescription)") + + it("decodes form") { + sut = FWJSON(data: TestFixtures.formData) + sut.decode { (result: Result) in + switch result { + case .success(let form): + expect(form.title).to(equal(TestFixtures.form.title)) + expect(form.components.count).to(equal(TestFixtures.form.components.count)) + expect(form.id).to(equal(TestFixtures.form.id)) + expect(form.responseFormat).to(equal(TestFixtures.form.responseFormat)) + expect(form.style).to(equal(TestFixtures.form.style)) + case .failure(let error): + expect(error).to(beNil(), description: "Error decoding form: \(error.localizedDescription)") + } + } } - } - } - - func testDecodeComponents() { - sut = FWJSON(data: TestFixtures.textComponentData) - sut.decode { (result: Result) in - switch result { - case .success(let component): - let errorMessage = "Text Component does not match it's decoded format" - XCTAssertEqual(component.title, TestFixtures.textComponent.title, errorMessage) - XCTAssertEqual(component.description, TestFixtures.textComponent.description, errorMessage) - XCTAssertEqual(component.required, TestFixtures.textComponent.required, errorMessage) - case .failure(let error): - XCTAssertNil(error, "Error decoding single line component: \(error.localizedDescription)") + + it("decodes components") { + sut = FWJSON(data: TestFixtures.textComponentData) + sut.decode { (result: Result) in + switch result { + case .success(let component): + expect(component.title).to(equal(TestFixtures.textComponent.title)) + expect(component.description).to(equal(TestFixtures.textComponent.description)) + expect(component.required).to(equal(TestFixtures.textComponent.required)) + case .failure(let error): + expect(error).to(beNil(), description: "Error decoding single line component: \(error.localizedDescription)") + } + } } } } - + static var allTests = [ - ("testEmptyData", testEmptyData), - ("testBadComponentData", testBadComponentData), - ("testDecodeForm", testDecodeForm), - ("testDecodeComponents", testDecodeComponents) + ("tests", spec) ] } diff --git a/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift b/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift index cb7544dd..3f3eb580 100644 --- a/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift +++ b/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift @@ -7,21 +7,28 @@ import XCTest import UIKit +import Quick +import Nimble @testable import Formworks -final class ManualLayoutTests: XCTestCase { +final class ManualLayoutSpec: QuickSpec { @ManualLayout var sut: UIView + override func spec() { - func testTranslatesAutoresizingMaskIntoConstraints() { - XCTAssertFalse(sut.translatesAutoresizingMaskIntoConstraints) + describe("the view") { + context("has") { + it("translatesAutoresizingMaskIntoConstraints setted as false") { + expect(self.sut.translatesAutoresizingMaskIntoConstraints).to(beFalse()) + } + + it("frame setted as zero") { + expect(self.sut.frame).to(equal(CGRect(x: 0, y: 0, width: 0, height: 0))) + } + } + } } - - func testFrameZero() { - XCTAssertEqual(sut.frame, CGRect(x: 0, y: 0, width: 0, height: 0)) - } - + static var allTests = [ - ("testTranslatesAutoresizingMaskIntoConstraints", testTranslatesAutoresizingMaskIntoConstraints), - ("testFrameZero", testFrameZero) + ("tests", spec) ] } diff --git a/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift b/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift index 19c03a90..4b7d9638 100644 --- a/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift +++ b/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift @@ -6,207 +6,198 @@ // import XCTest +import Quick +import Nimble @testable import Formworks -class FWRegexValidatorTests: XCTestCase { - var sut: FWRegexValidator! - - override func tearDown() { - super.tearDown() - sut = nil - } - - // MARK: Email - func testEmailValidationSuccess() { - let regex = FWRegex.email.rawValue - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("test@example.com") - XCTAssertTrue(result) - - result = sut.validate("test01@example.com") - XCTAssertTrue(result) - - result = sut.validate("test@example01.com") - XCTAssertTrue(result) - } - - func testEmailValidationFail() { - let regex = FWRegex.email.rawValue - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("this is not an email") - XCTAssertFalse(result) - - result = sut.validate("test@example") - XCTAssertFalse(result) - - result = sut.validate("testexample.com") - XCTAssertFalse(result) - - result = sut.validate("test@@example.com") - XCTAssertFalse(result) - - result = sut.validate("#test@example.com") - XCTAssertFalse(result) - - result = sut.validate("test@#example.com") - XCTAssertFalse(result) - - result = sut.validate("") - XCTAssertFalse(result) - } - - // MARK: Phonenumber - func testPhonenumberValidationSuccess() { - let regex = FWRegex.phonenumber.rawValue - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("00 1234 1234") - XCTAssertTrue(result) - - result = sut.validate("00 12345 1234") - XCTAssertTrue(result) - - result = sut.validate("(00)1234-1234") - XCTAssertTrue(result) - - result = sut.validate("(00)12345-1234") - XCTAssertTrue(result) - - result = sut.validate("(00)12345678") - XCTAssertTrue(result) - - result = sut.validate("(00)123456789") - XCTAssertTrue(result) - - result = sut.validate("(00) 1234 1234") - XCTAssertTrue(result) - - result = sut.validate("(00) 12345 1234") - XCTAssertTrue(result) - - result = sut.validate("(00) 12345678") - XCTAssertTrue(result) - - result = sut.validate("(00) 123456789") - XCTAssertTrue(result) - - result = sut.validate("(000)1234 1234") - XCTAssertTrue(result) - - result = sut.validate("(000)12345 1234") - XCTAssertTrue(result) - } - - func testPhonenumberValidationFail() { - let regex = FWRegex.phonenumber.rawValue - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("This is not a phonenumber") - XCTAssertFalse(result) - - result = sut.validate("0012345678") - XCTAssertTrue(result) - - result = sut.validate("00123456789") - XCTAssertTrue(result) - - result = sut.validate("12345678") - XCTAssertFalse(result) - - result = sut.validate("123456789") - XCTAssertFalse(result) - - result = sut.validate("11 1234@5678") - XCTAssertFalse(result) - - result = sut.validate("(0000)000000000") - XCTAssertFalse(result) - - result = sut.validate("0000000000000") - XCTAssertTrue(result) - - result = sut.validate("123") - XCTAssertFalse(result) - - result = sut.validate("") - XCTAssertFalse(result) - } - - // MARK: Max32 - func testMax32ValidationSuccess() { - let regex = FWRegex.max32.rawValue - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("This is a test text") - XCTAssertTrue(result) - - result = sut.validate("This is a 32 characters text! =)") - XCTAssertTrue(result) - } - - func testMax32ValidationFail() { - let regex = FWRegex.max32.rawValue - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("This is a text with 33 characters") - XCTAssertFalse(result) - - result = sut.validate("This text have more than 32 characters. To be more exact, this text is 90 characters long.") - XCTAssertFalse(result) - } - - // MARK: Custom - func testCustomValidationSuccess() { - let regex = "[a-z]at" - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("hat") - XCTAssertTrue(result) - - result = sut.validate("rat") - XCTAssertTrue(result) - - result = sut.validate("cat") - XCTAssertTrue(result) - - result = sut.validate("bat") - XCTAssertTrue(result) - } - - func testCustomValidationFail() { - let regex = "[a-z]at" - sut = FWRegexValidator(regex: regex) - - var result = sut.validate("1at") - XCTAssertFalse(result) - - result = sut.validate("@at") - XCTAssertFalse(result) - - result = sut.validate("chat") - XCTAssertFalse(result) - - result = sut.validate("battery") - XCTAssertFalse(result) - - result = sut.validate("banana") - XCTAssertFalse(result) +final class FWRegexValidatorSpec: QuickSpec { + override func spec() { + var sut: FWRegexValidator! + describe("is valid") { + context("when the regex is") { + it("an email") { + let regex = FWRegex.email.rawValue + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("test@example.com") + expect(result).to(beTrue()) + + result = sut.validate("test01@example.com") + expect(result).to(beTrue()) + + result = sut.validate("test@example01.com") + expect(result).to(beTrue()) + } + + it ("a phonenumber") { + let regex = FWRegex.phonenumber.rawValue + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("0012345678") + expect(result).to(beTrue()) + + result = sut.validate("00123456789") + expect(result).to(beTrue()) + + result = sut.validate("00 1234 1234") + expect(result).to(beTrue()) + + result = sut.validate("00 12345 1234") + expect(result).to(beTrue()) + + result = sut.validate("(00)1234-1234") + expect(result).to(beTrue()) + + result = sut.validate("(00)12345-1234") + expect(result).to(beTrue()) + + result = sut.validate("(00)12345678") + expect(result).to(beTrue()) + + result = sut.validate("(00)123456789") + expect(result).to(beTrue()) + + result = sut.validate("(00) 1234 1234") + expect(result).to(beTrue()) + + result = sut.validate("(00) 12345 1234") + expect(result).to(beTrue()) + + result = sut.validate("(00) 12345678") + expect(result).to(beTrue()) + + result = sut.validate("(00) 123456789") + expect(result).to(beTrue()) + + result = sut.validate("(000)1234 1234") + expect(result).to(beTrue()) + + result = sut.validate("(000)12345 1234") + expect(result).to(beTrue()) + + result = sut.validate("0000123456789") + expect(result).to(beTrue()) + } + + it("a max32") { + let regex = FWRegex.max32.rawValue + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("This is a test text") + expect(result).to(beTrue()) + + result = sut.validate("This is a 32 characters text! =)") + expect(result).to(beTrue()) + } + + it("custom") { + let regex = "[a-z]at" + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("hat") + expect(result).to(beTrue()) + + result = sut.validate("rat") + expect(result).to(beTrue()) + + result = sut.validate("cat") + expect(result).to(beTrue()) + + result = sut.validate("bat") + expect(result).to(beTrue()) + } + } + } + + describe("is invalid") { + context("when the regex is") { + it("an email") { + let regex = FWRegex.email.rawValue + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("this is not an email") + expect(result).to(beFalse()) + + result = sut.validate("test@example") + expect(result).to(beFalse()) + + result = sut.validate("testexample.com") + expect(result).to(beFalse()) + + result = sut.validate("test@@example.com") + expect(result).to(beFalse()) + + result = sut.validate("#test@example.com") + expect(result).to(beFalse()) + + result = sut.validate("test@#example.com") + expect(result).to(beFalse()) + + result = sut.validate("") + expect(result).to(beFalse()) + } + + it("a phonenumber") { + let regex = FWRegex.phonenumber.rawValue + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("This is not a phonenumber") + expect(result).to(beFalse()) + + result = sut.validate("12345678") + expect(result).to(beFalse()) + + result = sut.validate("123456789") + expect(result).to(beFalse()) + + result = sut.validate("11 1234@5678") + expect(result).to(beFalse()) + + result = sut.validate("(0000)000000000") + expect(result).to(beFalse()) + + result = sut.validate("123") + expect(result).to(beFalse()) + + result = sut.validate("") + expect(result).to(beFalse()) + } + + it("a max32") { + let regex = FWRegex.max32.rawValue + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("This is a text with 33 characters") + expect(result).to(beFalse()) + + result = sut.validate("This text have more than 32 characters. To be more exact, this text is 90 characters long.") + expect(result).to(beFalse()) + } + + it("custom") { + let regex = "[a-z]at" + sut = FWRegexValidator(regex: regex) + + var result = sut.validate("1at") + expect(result).to(beFalse()) + + result = sut.validate("@at") + expect(result).to(beFalse()) + + result = sut.validate("chat") + expect(result).to(beFalse()) + + result = sut.validate("battery") + expect(result).to(beFalse()) + + result = sut.validate("banana") + expect(result).to(beFalse()) + } + } + } } static var allTests = [ - ("testEmailValidationSuccess", testEmailValidationSuccess), - ("testEmailValidationFail", testEmailValidationFail), - - ("testPhonenumberValidationSuccess", testPhonenumberValidationSuccess), - ("testPhonenumberValidationFail", testPhonenumberValidationFail), - - ("testMax32ValidationSuccess", testMax32ValidationSuccess), - ("testMax32ValidationFail", testMax32ValidationFail), - - ("testCustomValidationSuccess", testCustomValidationSuccess), - ("testCustomValidationFail", testCustomValidationFail) + ("tests", spec) ] - } diff --git a/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift b/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift index e80b09f8..b12aadff 100644 --- a/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift +++ b/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift @@ -6,37 +6,44 @@ // import XCTest +import Quick +import Nimble @testable import Formworks -final class FWFormViewModelTests: XCTestCase { - var sut: FWFormViewModel! - - func testProperties() { - let configuration = FWConfiguration(json: TestFixtures.formData, style: .custom(FWStyleSpecification())) - sut = FWFormViewModel(configuration: configuration) - sut.setUp() - - XCTAssertEqual(sut.title, TestFixtures.form.title) - XCTAssertEqual(sut.numberOfComponents, TestFixtures.form.components.count) - XCTAssertEqual(sut.style, FWStyle.custom(TestFixtures.styleSpec)) - } - - func testViewModelAt() { - let configuration = FWConfiguration(json: TestFixtures.formData, style: .light) - sut = FWFormViewModel(configuration: configuration) - sut.setUp() +final class FWFormViewModelSpec: QuickSpec { + override func spec() { + var sut: FWFormViewModel! - let sutViewModelAt = sut.viewModelAt(index: IndexPath(row: 0, section: 0)) - let viewModel = FWTextComponentViewModel(model: TestFixtures.form.components[0] as! FWTextModel) + describe("the properties") { + it ("are correct") { + let configuration = FWConfiguration(json: TestFixtures.formData, style: .custom(FWStyleSpecification())) + sut = FWFormViewModel(configuration: configuration) + sut.setUp() - XCTAssertEqual(sutViewModelAt.description, viewModel.description) - XCTAssertEqual(sutViewModelAt.isValid, viewModel.isValid) - XCTAssertEqual(sutViewModelAt.required, viewModel.required) - XCTAssertEqual(sutViewModelAt.title, viewModel.title) - } + expect(sut.title).to(equal(TestFixtures.form.title)) + expect(sut.numberOfComponents).to(equal(TestFixtures.form.components.count)) + expect(sut.style).to(equal(FWStyle.custom(TestFixtures.styleSpec))) + } + } + + describe("the view model") { + it("is at index path") { + let configuration = FWConfiguration(json: TestFixtures.formData, style: .light) + sut = FWFormViewModel(configuration: configuration) + sut.setUp() + + let sutViewModelAt = sut.viewModelAt(index: IndexPath(row: 0, section: 0)) + let viewModel = FWTextComponentViewModel(model: TestFixtures.form.components[0] as! FWTextModel) - override func tearDown() { - super.tearDown() - sut = nil + expect(sutViewModelAt.description).to(equal(viewModel.description)) + expect(sutViewModelAt.isValid).to(equal(viewModel.isValid)) + expect(sutViewModelAt.required).to(equal(viewModel.required)) + expect(sutViewModelAt.title).to(equal(viewModel.title)) + } + } } + + static var allTests = [ + ("tests", spec) + ] } From 85df7124d12a7bcfd252ce21211da3ae1b8495d7 Mon Sep 17 00:00:00 2001 From: EdgSgroi Date: Thu, 1 Jul 2021 20:38:53 -0300 Subject: [PATCH 2/2] Delete uselessheader comments --- Sources/Formworks/Design System/ComponentSpec.swift | 7 ------- Sources/Formworks/Design System/FWStyle.swift | 7 ------- Sources/Formworks/Design System/FWStyleSpecification.swift | 7 ------- Sources/Formworks/Extensions/UIColor+Extension.swift | 7 ------- Sources/Formworks/Extensions/UIFont+Extension.swift | 7 ------- .../Formworks/Extensions/UIViewController+Extension.swift | 7 ------- .../FWComponents/FWComponent/FWComponentCell.swift | 7 ------- .../FWComponents/FWComponent/FWComponentModel.swift | 7 ------- .../FWComponents/FWComponent/FWComponentModelWrapper.swift | 7 ------- .../FWComponents/FWComponent/FWComponentViewModel.swift | 7 ------- Sources/Formworks/FWComponents/FWFields/FWLabel.swift | 7 ------- Sources/Formworks/FWComponents/FWFields/FWTextField.swift | 7 ------- Sources/Formworks/FWComponents/FWFields/FWTextView.swift | 7 ------- .../FWMultilineComponent/FWMultilineComponentView.swift | 7 ------- .../FWMultilineComponentViewModel.swift | 7 ------- .../FWComponents/FWTextComponent/FWTextComponentView.swift | 7 ------- .../FWTextComponent/FWTextComponentViewModel.swift | 7 ------- .../FWComponents/FWTextComponent/FWTextModel.swift | 7 ------- Sources/Formworks/FWForm/FWFormModel.swift | 7 ------- Sources/Formworks/FWForm/FWFormViewController.swift | 6 ------ .../Formworks/FWForm/FWFormViewModel/FWFormViewModel.swift | 7 ------- .../FWForm/FWFormViewModel/FWFormViewModelError.swift | 7 ------- Sources/Formworks/FWForm/FWFormViews/FWDismissHeader.swift | 7 ------- .../FWForm/FWFormViews/FWFormSubmitTableCell.swift | 7 ------- Sources/Formworks/FWSnapshots/FWComponentSnapshot.swift | 7 ------- Sources/Formworks/FWSnapshots/FWFormSnapshot.swift | 7 ------- .../Formworks/FWSnapshots/FWTextComponentSnapshot.swift | 7 ------- Sources/Formworks/Form Generation/FWConfiguration.swift | 7 ------- Sources/Formworks/JSON Decoder/FWJSON.swift | 7 ------- Sources/Formworks/Property Wrappers/ManualLayout.swift | 7 ------- Sources/Formworks/Validators/FWRegexValidator.swift | 7 ------- Sources/Formworks/Validators/FWValidator.swift | 7 ------- Tests/FormworksTests/JSON Decoder/FWJSONTests.swift | 7 ------- .../Property Wrappers/ManualLayoutTests.swift | 7 ------- Tests/FormworksTests/TestFixtures.swift | 7 ------- .../FormworksTests/Validators/FWRegexValidatorTests.swift | 7 ------- Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift | 7 ------- 37 files changed, 258 deletions(-) diff --git a/Sources/Formworks/Design System/ComponentSpec.swift b/Sources/Formworks/Design System/ComponentSpec.swift index 9259a67a..1929a4d7 100644 --- a/Sources/Formworks/Design System/ComponentSpec.swift +++ b/Sources/Formworks/Design System/ComponentSpec.swift @@ -1,10 +1,3 @@ -// -// ComponentSpec.swift -// -// -// Created by Artur Carneiro on 02/10/20. -// - import UIKit /// Used to specificate the components settings. diff --git a/Sources/Formworks/Design System/FWStyle.swift b/Sources/Formworks/Design System/FWStyle.swift index f9274598..84b4ba37 100644 --- a/Sources/Formworks/Design System/FWStyle.swift +++ b/Sources/Formworks/Design System/FWStyle.swift @@ -1,10 +1,3 @@ -// -// FWStyle.swift -// -// -// Created by Cassia Aparecida Barbosa on 29/10/20. -// - import Foundation /// The form's color style. diff --git a/Sources/Formworks/Design System/FWStyleSpecification.swift b/Sources/Formworks/Design System/FWStyleSpecification.swift index f6bfa7e1..2249b610 100644 --- a/Sources/Formworks/Design System/FWStyleSpecification.swift +++ b/Sources/Formworks/Design System/FWStyleSpecification.swift @@ -1,10 +1,3 @@ -// -// FWStyleSpecification.swift -// -// -// Created by Cassia Aparecida Barbosa on 29/10/20. -// - import UIKit /// The custom color style specification. diff --git a/Sources/Formworks/Extensions/UIColor+Extension.swift b/Sources/Formworks/Extensions/UIColor+Extension.swift index 5c2c9af0..b792804a 100644 --- a/Sources/Formworks/Extensions/UIColor+Extension.swift +++ b/Sources/Formworks/Extensions/UIColor+Extension.swift @@ -1,10 +1,3 @@ -// -// UIColor+Extension.swift -// -// -// Created by Victor Falcetta do Nascimento on 01/10/20. -// - import UIKit extension UIColor { diff --git a/Sources/Formworks/Extensions/UIFont+Extension.swift b/Sources/Formworks/Extensions/UIFont+Extension.swift index bebe90d0..c1ef9c03 100644 --- a/Sources/Formworks/Extensions/UIFont+Extension.swift +++ b/Sources/Formworks/Extensions/UIFont+Extension.swift @@ -1,10 +1,3 @@ -// -// UIFont+Extension.swift -// -// -// Created by Artur Carneiro on 02/10/20. -// - import UIKit extension UIFont { diff --git a/Sources/Formworks/Extensions/UIViewController+Extension.swift b/Sources/Formworks/Extensions/UIViewController+Extension.swift index 5b78f11a..c69c21f2 100644 --- a/Sources/Formworks/Extensions/UIViewController+Extension.swift +++ b/Sources/Formworks/Extensions/UIViewController+Extension.swift @@ -1,10 +1,3 @@ -// -// UIViewController+Extension.swift -// SampleMacro -// -// Created by Rafael Galdino on 18/11/20. -// - import UIKit extension UIViewController { diff --git a/Sources/Formworks/FWComponents/FWComponent/FWComponentCell.swift b/Sources/Formworks/FWComponents/FWComponent/FWComponentCell.swift index 43a4cd2e..bb1ff0e0 100644 --- a/Sources/Formworks/FWComponents/FWComponent/FWComponentCell.swift +++ b/Sources/Formworks/FWComponents/FWComponent/FWComponentCell.swift @@ -1,10 +1,3 @@ -// -// FWComponentCell.swift -// -// -// Created by Artur Carneiro on 13/10/20. -// - import UIKit /// Protocol specifying the component's cell view implementation. diff --git a/Sources/Formworks/FWComponents/FWComponent/FWComponentModel.swift b/Sources/Formworks/FWComponents/FWComponent/FWComponentModel.swift index caaf52c5..22dc8265 100644 --- a/Sources/Formworks/FWComponents/FWComponent/FWComponentModel.swift +++ b/Sources/Formworks/FWComponents/FWComponent/FWComponentModel.swift @@ -1,10 +1,3 @@ -// -// FWComponentData.swift -// -// -// Created by Cassia Aparecida Barbosa on 02/10/20. -// - import Foundation /// Protocol specifying a component's data structure. diff --git a/Sources/Formworks/FWComponents/FWComponent/FWComponentModelWrapper.swift b/Sources/Formworks/FWComponents/FWComponent/FWComponentModelWrapper.swift index 0a93c725..2d45d9f5 100644 --- a/Sources/Formworks/FWComponents/FWComponent/FWComponentModelWrapper.swift +++ b/Sources/Formworks/FWComponents/FWComponent/FWComponentModelWrapper.swift @@ -1,10 +1,3 @@ -// -// FWDecodedComponentModel.swift -// -// -// Created by Victor Falcetta do Nascimento on 03/11/20. -// - import Foundation /// Data structure for components being decoded. diff --git a/Sources/Formworks/FWComponents/FWComponent/FWComponentViewModel.swift b/Sources/Formworks/FWComponents/FWComponent/FWComponentViewModel.swift index e36687a3..4e48810b 100644 --- a/Sources/Formworks/FWComponents/FWComponent/FWComponentViewModel.swift +++ b/Sources/Formworks/FWComponents/FWComponent/FWComponentViewModel.swift @@ -1,10 +1,3 @@ -// -// FWComponentViewModel.swift -// -// -// Created by Edgar Sgroi on 15/10/20. -// - import Foundation /// Protocol specifying the component's data structure. diff --git a/Sources/Formworks/FWComponents/FWFields/FWLabel.swift b/Sources/Formworks/FWComponents/FWFields/FWLabel.swift index d3366a03..364b20d3 100644 --- a/Sources/Formworks/FWComponents/FWFields/FWLabel.swift +++ b/Sources/Formworks/FWComponents/FWFields/FWLabel.swift @@ -1,10 +1,3 @@ -// -// FWLabel.swift -// -// -// Created by Artur Carneiro on 02/10/20. -// - import UIKit /// `Formworks` custom `UILabel` implementation diff --git a/Sources/Formworks/FWComponents/FWFields/FWTextField.swift b/Sources/Formworks/FWComponents/FWFields/FWTextField.swift index fbd1d8e8..8f2aff78 100644 --- a/Sources/Formworks/FWComponents/FWFields/FWTextField.swift +++ b/Sources/Formworks/FWComponents/FWFields/FWTextField.swift @@ -1,10 +1,3 @@ -// -// FWTextField.swift -// -// -// Created by Artur Carneiro on 02/10/20. -// - import UIKit /// `Formworks` custom `UITextField` implementation diff --git a/Sources/Formworks/FWComponents/FWFields/FWTextView.swift b/Sources/Formworks/FWComponents/FWFields/FWTextView.swift index 56f72e8c..6a9a099c 100644 --- a/Sources/Formworks/FWComponents/FWFields/FWTextView.swift +++ b/Sources/Formworks/FWComponents/FWFields/FWTextView.swift @@ -1,10 +1,3 @@ -// -// FWTextView.swift -// -// -// Created by Rafael Galdino on 23/11/20. -// - import UIKit /// `Formworks` custom `UITextView` implementation diff --git a/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentView.swift b/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentView.swift index 405b2cc0..606df50f 100644 --- a/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentView.swift +++ b/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentView.swift @@ -1,10 +1,3 @@ -// -// FWMultilineComponentView.swift -// -// -// Created by Rafael Galdino on 23/11/20. -// - import UIKit /// Visual representation for the multiline component. Subclasses `UITableViewCell`. diff --git a/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentViewModel.swift b/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentViewModel.swift index a8e2b356..faa18031 100644 --- a/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentViewModel.swift +++ b/Sources/Formworks/FWComponents/FWMultilineComponent/FWMultilineComponentViewModel.swift @@ -1,10 +1,3 @@ -// -// FWMultilineComponentViewModel.swift -// -// -// Created by Rafael Galdino on 23/11/20. -// - import Foundation // MARK: Protocol-Delegate diff --git a/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentView.swift b/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentView.swift index ba6ffcc4..2a2d3b73 100644 --- a/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentView.swift +++ b/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentView.swift @@ -1,10 +1,3 @@ -// -// FWTextComponentView.swift -// -// -// Created by Victor Falcetta do Nascimento on 05/11/20. -// - import UIKit /// Visual representation for the multiline component. Subclasses `UITableViewCell`. diff --git a/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentViewModel.swift b/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentViewModel.swift index e27c2e35..e786114f 100644 --- a/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentViewModel.swift +++ b/Sources/Formworks/FWComponents/FWTextComponent/FWTextComponentViewModel.swift @@ -1,10 +1,3 @@ -// -// FWTextComponentViewModel.swift -// -// -// Created by Victor Falcetta do Nascimento on 09/11/20. -// - import Foundation // MARK: Protocol-Delegate diff --git a/Sources/Formworks/FWComponents/FWTextComponent/FWTextModel.swift b/Sources/Formworks/FWComponents/FWTextComponent/FWTextModel.swift index b0006c0e..ecada5bf 100644 --- a/Sources/Formworks/FWComponents/FWTextComponent/FWTextModel.swift +++ b/Sources/Formworks/FWComponents/FWTextComponent/FWTextModel.swift @@ -1,10 +1,3 @@ -// -// FWSingleLineModel.swift -// -// -// Created by Victor Falcetta do Nascimento on 03/11/20. -// - import Foundation /// A text component data struct. Title is the only required value for initialising. diff --git a/Sources/Formworks/FWForm/FWFormModel.swift b/Sources/Formworks/FWForm/FWFormModel.swift index b3a59135..11af622d 100644 --- a/Sources/Formworks/FWForm/FWFormModel.swift +++ b/Sources/Formworks/FWForm/FWFormModel.swift @@ -1,10 +1,3 @@ -// -// FWFormModel.swift -// -// -// Created by Cassia Aparecida Barbosa on 02/10/20. -// - import Foundation /// Data structure for the form. diff --git a/Sources/Formworks/FWForm/FWFormViewController.swift b/Sources/Formworks/FWForm/FWFormViewController.swift index 248457d5..593ccefc 100644 --- a/Sources/Formworks/FWForm/FWFormViewController.swift +++ b/Sources/Formworks/FWForm/FWFormViewController.swift @@ -1,9 +1,3 @@ -// -// FWFormController.swift -// -// -// Created by Artur Carneiro on 29/09/20. -// import UIKit // MARK: Protocol-Delegate diff --git a/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModel.swift b/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModel.swift index f4a6fbbe..38e1ec11 100644 --- a/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModel.swift +++ b/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModel.swift @@ -1,10 +1,3 @@ -// -// FWFormViewModel.swift -// -// -// Created by Cassia Aparecida Barbosa on 07/10/20. -// - import Foundation // MARK: Protocol-delegate diff --git a/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModelError.swift b/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModelError.swift index ea5a4459..5d814a9d 100644 --- a/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModelError.swift +++ b/Sources/Formworks/FWForm/FWFormViewModel/FWFormViewModelError.swift @@ -1,10 +1,3 @@ -// -// FWFormViewModelError.swift -// -// -// Created by Artur Carneiro on 13/11/20. -// - import Foundation /// Possible errors when interacting with `FWFormViewModel`. diff --git a/Sources/Formworks/FWForm/FWFormViews/FWDismissHeader.swift b/Sources/Formworks/FWForm/FWFormViews/FWDismissHeader.swift index f89aeebe..cd7752cd 100644 --- a/Sources/Formworks/FWForm/FWFormViews/FWDismissHeader.swift +++ b/Sources/Formworks/FWForm/FWFormViews/FWDismissHeader.swift @@ -1,10 +1,3 @@ -// -// DismissHFWDismissHeadereader.swift -// -// -// Created by Cassia Aparecida Barbosa on 16/11/20. -// - import UIKit final class FWDismissHeader: UITableViewHeaderFooterView { diff --git a/Sources/Formworks/FWForm/FWFormViews/FWFormSubmitTableCell.swift b/Sources/Formworks/FWForm/FWFormViews/FWFormSubmitTableCell.swift index 431da7a3..12f619bc 100644 --- a/Sources/Formworks/FWForm/FWFormViews/FWFormSubmitTableCell.swift +++ b/Sources/Formworks/FWForm/FWFormViews/FWFormSubmitTableCell.swift @@ -1,10 +1,3 @@ -// -// FWFormCollectionCell.swift -// -// -// Created by Victor Falcetta do Nascimento on 30/09/20. -// - import UIKit /// A representation of a `Formworks` `UITableViewCell`'s cell. diff --git a/Sources/Formworks/FWSnapshots/FWComponentSnapshot.swift b/Sources/Formworks/FWSnapshots/FWComponentSnapshot.swift index 553b4975..7749a9ba 100644 --- a/Sources/Formworks/FWSnapshots/FWComponentSnapshot.swift +++ b/Sources/Formworks/FWSnapshots/FWComponentSnapshot.swift @@ -1,10 +1,3 @@ -// -// FWComponentSnapshot.swift -// -// -// Created by Cassia Aparecida Barbosa on 16/10/20. -// - import Foundation /// Protocol specifying the characteristics of a component snapshot. diff --git a/Sources/Formworks/FWSnapshots/FWFormSnapshot.swift b/Sources/Formworks/FWSnapshots/FWFormSnapshot.swift index 6f85b218..382436e8 100644 --- a/Sources/Formworks/FWSnapshots/FWFormSnapshot.swift +++ b/Sources/Formworks/FWSnapshots/FWFormSnapshot.swift @@ -1,10 +1,3 @@ -// -// FWFormSnapshot.swift -// -// -// Created by Cassia Aparecida Barbosa on 16/10/20. -// - import Foundation /// Form response data structure. diff --git a/Sources/Formworks/FWSnapshots/FWTextComponentSnapshot.swift b/Sources/Formworks/FWSnapshots/FWTextComponentSnapshot.swift index d5b029ec..3357d88b 100644 --- a/Sources/Formworks/FWSnapshots/FWTextComponentSnapshot.swift +++ b/Sources/Formworks/FWSnapshots/FWTextComponentSnapshot.swift @@ -1,10 +1,3 @@ -// -// FWTextComponentSnapshot.swift -// -// -// Created by Artur Carneiro on 10/11/20. -// - import Foundation /// Snapshot of the information of a text component. diff --git a/Sources/Formworks/Form Generation/FWConfiguration.swift b/Sources/Formworks/Form Generation/FWConfiguration.swift index aefed818..81bea2fa 100644 --- a/Sources/Formworks/Form Generation/FWConfiguration.swift +++ b/Sources/Formworks/Form Generation/FWConfiguration.swift @@ -1,10 +1,3 @@ -// -// FWConfiguration.swift -// -// -// Created by Cassia Aparecida Barbosa on 29/10/20. -// - import Foundation /// The configuration used to create a form. diff --git a/Sources/Formworks/JSON Decoder/FWJSON.swift b/Sources/Formworks/JSON Decoder/FWJSON.swift index 57bddcc1..3523b229 100644 --- a/Sources/Formworks/JSON Decoder/FWJSON.swift +++ b/Sources/Formworks/JSON Decoder/FWJSON.swift @@ -1,10 +1,3 @@ -// -// FWJSONDecoder.swift -// -// -// Created by Victor Falcetta do Nascimento on 05/10/20. -// - import Foundation /// This class is reponsible to get the JSON and transform in data. diff --git a/Sources/Formworks/Property Wrappers/ManualLayout.swift b/Sources/Formworks/Property Wrappers/ManualLayout.swift index fcdd2247..23f99117 100644 --- a/Sources/Formworks/Property Wrappers/ManualLayout.swift +++ b/Sources/Formworks/Property Wrappers/ManualLayout.swift @@ -1,10 +1,3 @@ -// -// ManualLayout.swift -// -// -// Created by Artur Carneiro on 28/09/20. -// - import UIKit /** diff --git a/Sources/Formworks/Validators/FWRegexValidator.swift b/Sources/Formworks/Validators/FWRegexValidator.swift index 8fbad254..0d8b6c51 100644 --- a/Sources/Formworks/Validators/FWRegexValidator.swift +++ b/Sources/Formworks/Validators/FWRegexValidator.swift @@ -1,10 +1,3 @@ -// -// FWRegexValidator.swift -// -// -// Created by Edgar Sgroi on 29/10/20. -// - import Foundation // MARK: FWRegex diff --git a/Sources/Formworks/Validators/FWValidator.swift b/Sources/Formworks/Validators/FWValidator.swift index 14b06476..63ba8209 100644 --- a/Sources/Formworks/Validators/FWValidator.swift +++ b/Sources/Formworks/Validators/FWValidator.swift @@ -1,10 +1,3 @@ -// -// FWValidator.swift -// -// -// Created by Artur Carneiro on 09/10/20. -// - import Foundation /// A protocol that every validator class need to conform to validate components. diff --git a/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift b/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift index 74162036..6654940e 100644 --- a/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift +++ b/Tests/FormworksTests/JSON Decoder/FWJSONTests.swift @@ -1,10 +1,3 @@ -// -// FWJSONTests.swift -// -// -// Created by Rafael Galdino on 07/10/20. -// - import XCTest import Quick import Nimble diff --git a/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift b/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift index c9a96c09..7c9e1a4b 100644 --- a/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift +++ b/Tests/FormworksTests/Property Wrappers/ManualLayoutTests.swift @@ -1,10 +1,3 @@ -// -// ManualLayoutTests.swift -// -// -// Created by Artur Carneiro on 28/09/20. -// - import XCTest import UIKit import Quick diff --git a/Tests/FormworksTests/TestFixtures.swift b/Tests/FormworksTests/TestFixtures.swift index aaa07aa5..a5790ccc 100644 --- a/Tests/FormworksTests/TestFixtures.swift +++ b/Tests/FormworksTests/TestFixtures.swift @@ -1,10 +1,3 @@ -// -// TestFixtures.swift -// -// -// Created by Rafael Galdino on 08/10/20. -// - import Foundation import UIKit @testable import Formworks diff --git a/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift b/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift index 2442ff45..43c04ec2 100644 --- a/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift +++ b/Tests/FormworksTests/Validators/FWRegexValidatorTests.swift @@ -1,10 +1,3 @@ -// -// FWRegexValidatorTests.swift -// FormworksTests -// -// Created by Edgar Sgroi on 29/10/20. -// - import XCTest import Quick import Nimble diff --git a/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift b/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift index b12aadff..e99f33de 100644 --- a/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift +++ b/Tests/FormworksTests/ViewModels/FWFormViewModelTests.swift @@ -1,10 +1,3 @@ -// -// FWFormViewModelTests.swift -// -// -// Created by Artur Carneiro on 13/11/20. -// - import XCTest import Quick import Nimble