Skip to content

Instantly share code, notes, and snippets.

@AviTsadok
Created July 23, 2019 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AviTsadok/a0faf4328662cd9098cf9a85b013bf86 to your computer and use it in GitHub Desktop.
Save AviTsadok/a0faf4328662cd9098cf9a85b013bf86 to your computer and use it in GitHub Desktop.
Protocol for Server Mock
import UIKit
protocol RestServerMockProtocol {
// get return a server response based on url and paramteres
func getResponseFor(urlString : String, with parameters : [AnyHashable : Any])->[AnyHashable : Any]
// load responses by filename. Needs to be done every time you start a test
func loadResponses(fromFile filename : String)
// insert a new request to the data. At the end save the result to the db
func recordRequest(request : String, with parameters : [AnyHashable : Any], response : [String : Any])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment