diff --git a/WorkflowCombine/Testing/PublisherTesting.swift b/WorkflowCombine/Testing/PublisherTesting.swift index 30edfc6e6..89d204fa4 100644 --- a/WorkflowCombine/Testing/PublisherTesting.swift +++ b/WorkflowCombine/Testing/PublisherTesting.swift @@ -22,16 +22,16 @@ import WorkflowTesting import XCTest @testable import WorkflowCombine -extension RenderTester { +public extension RenderTester { /// Expect a `Publisher`-based Workflow. /// /// `PublisherWorkflow` is used to subscribe to `Publisher`s. /// /// - Parameters: /// - publisher: Type of the Publisher-based Workflow to expect - /// - producingOutput: An output that should be returned when this worker is requested, if any. + /// - producingOutput: An output that will be returned when this worker is requested, if any. /// - key: Key to expect this `Workflow` to be rendered with. - public func expect( + func expect( publisher: PublisherType.Type, producingOutput output: PublisherType.Output? = nil, key: String = "" @@ -46,7 +46,7 @@ extension RenderTester { } @available(*, deprecated, renamed: "expect(publisher:producingOutput:key:)") - public func expect( + func expect( publisher: PublisherType.Type, output: PublisherType.Output, key: String = "" diff --git a/WorkflowCombine/Testing/WorkerTesting.swift b/WorkflowCombine/Testing/WorkerTesting.swift index 794faf653..5525c13f0 100644 --- a/WorkflowCombine/Testing/WorkerTesting.swift +++ b/WorkflowCombine/Testing/WorkerTesting.swift @@ -20,14 +20,14 @@ import WorkflowTesting import XCTest @testable import WorkflowCombine -extension RenderTester { +public extension RenderTester { /// Expect the given worker. It will be checked for `isEquivalent(to:)` with the requested worker. /// /// - Parameters: /// - worker: The worker to be expected - /// - producingOutput: An output that should be returned when this worker is requested, if any. + /// - producingOutput: An output that will be returned when this worker is requested, if any. /// - key: Key to expect this `Workflow` to be rendered with. - public func expect( + func expect( worker: ExpectedWorkerType, producingOutput output: ExpectedWorkerType.Output? = nil, key: String = "", diff --git a/WorkflowConcurrency/Testing/WorkerTesting.swift b/WorkflowConcurrency/Testing/WorkerTesting.swift index edf92e946..6e77f87eb 100644 --- a/WorkflowConcurrency/Testing/WorkerTesting.swift +++ b/WorkflowConcurrency/Testing/WorkerTesting.swift @@ -20,14 +20,14 @@ import WorkflowTesting import XCTest @testable import WorkflowConcurrency -extension RenderTester { +public extension RenderTester { /// Expect the given worker. It will be checked for `isEquivalent(to:)` with the requested worker. /// /// - Parameters: /// - worker: The worker to be expected - /// - producingOutput: An output that should be returned when this worker is requested, if any. + /// - producingOutput: An output that will be returned when this worker is requested, if any. /// - key: Key to expect this `Workflow` to be rendered with. - public func expect( + func expect( worker: ExpectedWorkerType, producingOutput output: ExpectedWorkerType.Output? = nil, key: String = "", diff --git a/WorkflowReactiveSwift/Testing/SignalProducerWorkflowTesting.swift b/WorkflowReactiveSwift/Testing/SignalProducerWorkflowTesting.swift index e1c3932d0..d52c5fc89 100644 --- a/WorkflowReactiveSwift/Testing/SignalProducerWorkflowTesting.swift +++ b/WorkflowReactiveSwift/Testing/SignalProducerWorkflowTesting.swift @@ -20,7 +20,7 @@ import WorkflowTesting import XCTest @testable import WorkflowReactiveSwift -extension RenderTester { +public extension RenderTester { /// Expect a `SignalProducer` with an optional output. /// /// `SignalProducerWorkflow` is used to subscribe to `SignalProducer`s and `Signal`s. @@ -29,9 +29,9 @@ extension RenderTester { /// /// - Parameters: /// - outputType: The `OutputType` of the expected `SignalProducerWorkflow`. Typically this will be correctly inferred by the type system, but may need to be explicitly specified if particular optionality is desired. - /// - producingOutput: An output that should be returned when this worker is requested, if any. + /// - producingOutput: An output that will be returned when this worker is requested, if any. /// - key: Key to expect this `Workflow` to be rendered with. - public func expectSignalProducer( + func expectSignalProducer( outputType: OutputType.Type = OutputType.self, producingOutput: OutputType? = nil, key: String = "", diff --git a/WorkflowReactiveSwift/Testing/WorkerTesting.swift b/WorkflowReactiveSwift/Testing/WorkerTesting.swift index 78d2b26bc..4a51eddee 100644 --- a/WorkflowReactiveSwift/Testing/WorkerTesting.swift +++ b/WorkflowReactiveSwift/Testing/WorkerTesting.swift @@ -20,14 +20,14 @@ import WorkflowTesting import XCTest @testable import WorkflowReactiveSwift -extension RenderTester { +public extension RenderTester { /// Expect the given worker. It will be checked for `isEquivalent(to:)` with the requested worker. /// /// - Parameters: /// - worker: The worker to be expected - /// - producingOutput: An output that should be returned when this worker is requested, if any. + /// - producingOutput: An output that will be returned when this worker is requested, if any. /// - key: Key to expect this `Workflow` to be rendered with. - public func expect( + func expect( worker: ExpectedWorkerType, producingOutput output: ExpectedWorkerType.Output? = nil, key: String = "", diff --git a/WorkflowRxSwift/Testing/ObservableTesting.swift b/WorkflowRxSwift/Testing/ObservableTesting.swift index b35dd937a..ff10e0c14 100644 --- a/WorkflowRxSwift/Testing/ObservableTesting.swift +++ b/WorkflowRxSwift/Testing/ObservableTesting.swift @@ -20,14 +20,14 @@ import WorkflowTesting import XCTest @testable import WorkflowRxSwift -extension RenderTester { +public extension RenderTester { /// Expect the given worker. It will be checked for `isEquivalent(to:)` with the requested worker. /// - Parameters: /// - outputType: The `OutputType` of the expected `ObservableWorkflow`. - /// - producingOutput: An output that should be returned when this worker is requested, if any. + /// - producingOutput: An output that will be returned when this worker is requested, if any. /// - key: Key to expect this `Workflow` to be rendered with. - public func expectObservable( + func expectObservable( outputType: OutputType.Type = OutputType.self, producingOutput output: OutputType? = nil, key: String = "", diff --git a/WorkflowRxSwift/Testing/WorkerTesting.swift b/WorkflowRxSwift/Testing/WorkerTesting.swift index f5b2d9192..75b94cece 100644 --- a/WorkflowRxSwift/Testing/WorkerTesting.swift +++ b/WorkflowRxSwift/Testing/WorkerTesting.swift @@ -20,13 +20,13 @@ import WorkflowTesting import XCTest @testable import WorkflowRxSwift -extension RenderTester { +public extension RenderTester { /// Expect the given worker. It will be checked for `isEquivalent(to:)` with the requested worker. /// - Parameters: /// - worker: The worker to be expected - /// - output: An output that should be returned when this worker is requested, if any. - public func expect( + /// - output: An output that will be returned when this worker is requested, if any. + func expect( worker: ExpectedWorkerType, producingOutput output: ExpectedWorkerType.Output? = nil, key: String = "", diff --git a/WorkflowTesting/Sources/WorkflowRenderTester.swift b/WorkflowTesting/Sources/WorkflowRenderTester.swift index f8c3d5ef7..6c2d34fc9 100644 --- a/WorkflowTesting/Sources/WorkflowRenderTester.swift +++ b/WorkflowTesting/Sources/WorkflowRenderTester.swift @@ -22,15 +22,15 @@ import XCTest @testable import Workflow -extension Workflow { +public extension Workflow { /// Returns a `RenderTester` with a specified initial state. - public func renderTester(initialState: Self.State) -> RenderTester { - return RenderTester(workflow: self, state: initialState) + func renderTester(initialState: Self.State) -> RenderTester { + RenderTester(workflow: self, state: initialState) } /// Returns a `RenderTester` with an initial state provided by `self.makeInitialState()` - public func renderTester() -> RenderTester { - return renderTester(initialState: makeInitialState()) + func renderTester() -> RenderTester { + renderTester(initialState: makeInitialState()) } } @@ -146,8 +146,8 @@ public struct RenderTester { /// - Parameters: /// - type: The type of the expected workflow. /// - key: The key of the expected workflow (if specified). - /// - rendering: The rendering result that should be returned when the workflow of this type is rendered. - /// - output: An output that should be returned after the workflow of this type is rendered, if any. + /// - rendering: The rendering result that will be returned when the workflow of this type is rendered. + /// - output: An output that will be returned after the workflow of this type is rendered, if any. /// - assertions: Additional assertions for the given workflow, if any. You may use this to assert the properties of the requested workflow are as expected. public func expectWorkflow( type: ExpectedWorkflowType.Type, @@ -157,7 +157,7 @@ public struct RenderTester { file: StaticString = #file, line: UInt = #line, assertions: @escaping (ExpectedWorkflowType) -> Void = { _ in } ) -> RenderTester { - return RenderTester( + RenderTester( workflow: workflow, state: state, expectedWorkflows: expectedWorkflows.appending( @@ -179,7 +179,7 @@ public struct RenderTester { /// - Parameters: /// - type: The type of the expected workflow. /// - key: The key of the expected workflow (if specified). - /// - rendering: The rendering result that should be returned when the workflow of this type is rendered. + /// - rendering: The rendering result that will be returned when the workflow of this type is rendered. /// - assertions: Additional assertions for the given workflow, if any. You may use this to assert the properties of the requested workflow are as expected. public func expectWorkflowIgnoringOutput( type: ExpectedWorkflowType.Type, @@ -189,7 +189,7 @@ public struct RenderTester { line: UInt = #line, assertions: @escaping (ExpectedWorkflowType) -> Void = { _ in } ) -> RenderTester { - return expectWorkflow( + expectWorkflow( type: OutputBlockingWorkflow.self, key: key, producingRendering: rendering, @@ -206,7 +206,7 @@ public struct RenderTester { key: AnyHashable, file: StaticString = #file, line: UInt = #line ) -> RenderTester { - return RenderTester( + RenderTester( workflow: workflow, state: state, expectedWorkflows: expectedWorkflows, @@ -231,7 +231,7 @@ public struct RenderTester { producingAction action: ActionType, file: StaticString = #file, line: UInt = #line ) -> RenderTester where ActionType: WorkflowAction, ActionType.WorkflowType == WorkflowType { - return RenderTester( + RenderTester( workflow: workflow, state: state, expectedWorkflows: expectedWorkflows, @@ -283,14 +283,14 @@ public struct RenderTester { } } -extension Collection { - fileprivate func appending(_ element: Element) -> [Element] { - return self + [element] +fileprivate extension Collection { + func appending(_ element: Element) -> [Element] { + self + [element] } } -extension Dictionary { - fileprivate func setting(key: Key, value: Value) -> [Key: Value] { +fileprivate extension Dictionary { + func setting(key: Key, value: Value) -> [Key: Value] { var newDictionary = self newDictionary[key] = value return newDictionary