Created
July 23, 2019 17:10
-
-
Save AviTsadok/a0faf4328662cd9098cf9a85b013bf86 to your computer and use it in GitHub Desktop.
Protocol for Server Mock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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