Skip to content

Commit

Permalink
Merge pull request #792 from DeluxeAlonso/feature/unit-tests
Browse files Browse the repository at this point in the history
Feature/unit tests - GenreClientProtocolMock
  • Loading branch information
DeluxeAlonso committed Sep 20, 2023
2 parents 42568ef + 0a42ea0 commit 7ce5687
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions NetworkInfrastructure/GenreClientProtocolMock.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// GenreClientProtocolMock.swift
// NetworkInfrastructure
//
// Created by Alonso on 20/09/23.
//

import UpcomingMoviesDomain

final class GenreClientProtocolMock: GenreClientProtocol {

var getAllGenresResult: Result<GenreResult, APIError>?
private(set) var getAllGenresCallCount = 0
func getAllGenres(completion: @escaping (Result<GenreResult, APIError>) -> Void) {
if let getAllGenresResult = getAllGenresResult {
completion(getAllGenresResult)
}
getAllGenresCallCount += 1
}

}

0 comments on commit 7ce5687

Please sign in to comment.