Skip to content

Instantly share code, notes, and snippets.

@codedeman
Last active September 20, 2022 02:06
Show Gist options
  • Save codedeman/d479ee9317eb352b9bb721539c1768e0 to your computer and use it in GitHub Desktop.
Save codedeman/d479ee9317eb352b9bb721539c1768e0 to your computer and use it in GitHub Desktop.
MockMovieInteractorTesting
class MockMovieInteractor:MovieInteractor {
var success = false
func performGetStatusRequest() {
if success {
self.viewModel.delegate?.success()
} else {
self.viewModel.delegate?.fail()
}
}
override func performGetListMovie() {
let listFilm:[FilmModel] = [
FilmModel.init(id: "1123", filmUrl: "", name: "Bat man", price: "19292929", imageSize: 0, age: "13"),
FilmModel.init(id: "11234", filmUrl: "", name: "Spider man", price: "1991992", imageSize: 0, age: "18"),
FilmModel.init(id: "11235", filmUrl: "", name: "Kings Man", price: "19292929", imageSize: 0, age: "13")
]
self.viewModel.delegate?.didGetListMovie(listMovie: listFilm)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment