From de9f53e497acb69f0a32d7def5e12e8f42ddffca Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Fri, 22 Mar 2024 15:40:11 +0100 Subject: [PATCH] Implemented the FeedListCoordinationSpy spy in the FeedTest framework. --- .../FeedListCoordinationSpy.swift | 21 ++++++++++++++ Reviews.xcodeproj/project.pbxproj | 28 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Frameworks/Feed/Test/Helpers/Spies/Coordination/FeedListCoordinationSpy.swift diff --git a/Frameworks/Feed/Test/Helpers/Spies/Coordination/FeedListCoordinationSpy.swift b/Frameworks/Feed/Test/Helpers/Spies/Coordination/FeedListCoordinationSpy.swift new file mode 100644 index 0000000..faae101 --- /dev/null +++ b/Frameworks/Feed/Test/Helpers/Spies/Coordination/FeedListCoordinationSpy.swift @@ -0,0 +1,21 @@ +// +// FeedListCoordinationSpy.swift +// ReviewsFeedTest +// +// Created by Javier Cicchelli on 22/03/2024. +// Copyright © 2024 Röck+Cöde. All rights reserved. +// + +@testable import ReviewsFeed + +final class FeedListCoordinationSpy: FeedListCoordination { + + // MARK: Properties + var itemOpened: Bool = false + + // MARK: Functions + func open(_ item: ReviewsFeed.Review) { + itemOpened = true + } + +} diff --git a/Reviews.xcodeproj/project.pbxproj b/Reviews.xcodeproj/project.pbxproj index 4f92294..654ef4f 100644 --- a/Reviews.xcodeproj/project.pbxproj +++ b/Reviews.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ 02B36F7D2BAD9D1A00F1A89D /* ReviewsFeed.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */; platformFilter = ios; }; 02B36F852BAD9DDB00F1A89D /* FeedListViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02B36F842BAD9DDB00F1A89D /* FeedListViewModelTests.swift */; }; 02B36F892BADB26C00F1A89D /* Array+ReviewDTOs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02B36F882BADB26C00F1A89D /* Array+ReviewDTOs.swift */; }; + 02B36F8F2BADCABC00F1A89D /* FeedListCoordinationSpy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02B36F8D2BADCA8000F1A89D /* FeedListCoordinationSpy.swift */; }; 02C1B1972BAC9BFE001781DE /* FeedListCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C1B1962BAC9BFE001781DE /* FeedListCoordinator.swift */; }; 02C1B1A92BACA722001781DE /* AppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C1B1A82BACA722001781DE /* AppCoordinator.swift */; }; 02DA924E2BAAE3FD00C47985 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 02DA924D2BAAE3FD00C47985 /* Localizable.xcstrings */; }; @@ -88,6 +89,7 @@ 02B36F792BAD9D1A00F1A89D /* FeedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FeedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 02B36F842BAD9DDB00F1A89D /* FeedListViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedListViewModelTests.swift; sourceTree = ""; }; 02B36F882BADB26C00F1A89D /* Array+ReviewDTOs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+ReviewDTOs.swift"; sourceTree = ""; }; + 02B36F8D2BADCA8000F1A89D /* FeedListCoordinationSpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedListCoordinationSpy.swift; sourceTree = ""; }; 02C1B1962BAC9BFE001781DE /* FeedListCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedListCoordinator.swift; sourceTree = ""; }; 02C1B1A82BACA722001781DE /* AppCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCoordinator.swift; sourceTree = ""; }; 02DA924D2BAAE3FD00C47985 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; @@ -246,6 +248,7 @@ 02A6DA302BA5929F00B943E2 /* Test */ = { isa = PBXGroup; children = ( + 02B36F8A2BADCA5B00F1A89D /* Helpers */, 02B36F742BAD9C4500F1A89D /* Tests */, ); path = Test; @@ -283,6 +286,30 @@ path = Extensions; sourceTree = ""; }; + 02B36F8A2BADCA5B00F1A89D /* Helpers */ = { + isa = PBXGroup; + children = ( + 02B36F8B2BADCA6200F1A89D /* Spies */, + ); + path = Helpers; + sourceTree = ""; + }; + 02B36F8B2BADCA6200F1A89D /* Spies */ = { + isa = PBXGroup; + children = ( + 02B36F8C2BADCA6A00F1A89D /* Coordination */, + ); + path = Spies; + sourceTree = ""; + }; + 02B36F8C2BADCA6A00F1A89D /* Coordination */ = { + isa = PBXGroup; + children = ( + 02B36F8D2BADCA8000F1A89D /* FeedListCoordinationSpy.swift */, + ); + path = Coordination; + sourceTree = ""; + }; 02C1B1952BAC9BE7001781DE /* Coordinators */ = { isa = PBXGroup; children = ( @@ -583,6 +610,7 @@ buildActionMask = 2147483647; files = ( 02B36F852BAD9DDB00F1A89D /* FeedListViewModelTests.swift in Sources */, + 02B36F8F2BADCABC00F1A89D /* FeedListCoordinationSpy.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };