From a2d9acbe2b509448cb0e5a6ee76e20d2b2ea837b Mon Sep 17 00:00:00 2001 From: DeluxeAlonso Date: Wed, 20 Sep 2023 00:28:36 -0500 Subject: [PATCH 1/2] Creates GenreClientProtocolMock file --- NetworkInfrastructure/GenreClientProtocolMock.swift | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 NetworkInfrastructure/GenreClientProtocolMock.swift diff --git a/NetworkInfrastructure/GenreClientProtocolMock.swift b/NetworkInfrastructure/GenreClientProtocolMock.swift new file mode 100644 index 00000000..4d81b563 --- /dev/null +++ b/NetworkInfrastructure/GenreClientProtocolMock.swift @@ -0,0 +1,8 @@ +// +// GenreClientProtocolMock.swift +// NetworkInfrastructure +// +// Created by Alonso on 20/09/23. +// + +import Foundation From 0a42ea00401e286e89ae5ed022c539cfe903d203 Mon Sep 17 00:00:00 2001 From: DeluxeAlonso Date: Wed, 20 Sep 2023 00:30:07 -0500 Subject: [PATCH 2/2] Implements GenreClientProtocolMock --- .../GenreClientProtocolMock.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/NetworkInfrastructure/GenreClientProtocolMock.swift b/NetworkInfrastructure/GenreClientProtocolMock.swift index 4d81b563..80e6c5ca 100644 --- a/NetworkInfrastructure/GenreClientProtocolMock.swift +++ b/NetworkInfrastructure/GenreClientProtocolMock.swift @@ -5,4 +5,17 @@ // Created by Alonso on 20/09/23. // -import Foundation +import UpcomingMoviesDomain + +final class GenreClientProtocolMock: GenreClientProtocol { + + var getAllGenresResult: Result? + private(set) var getAllGenresCallCount = 0 + func getAllGenres(completion: @escaping (Result) -> Void) { + if let getAllGenresResult = getAllGenresResult { + completion(getAllGenresResult) + } + getAllGenresCallCount += 1 + } + +}