cse403trackforever / trackforever

Top level repository for Track Forever
https://cse403trackforever.firebaseapp.com
MIT License
5 stars 0 forks source link

[Add] testing hooks #5

Closed chris-addison closed 6 years ago

djdupre commented 6 years ago

I don't like how these testing hooks require us to spam null checks everywhere. Can we instead separate the code that fetches the raw JSON into another file? I think something like this would be nice:

class GoogleCodePlugin(projectName: String, private val api: GoogleCodeAPI = GoogleCodeDefaultAPI(projectName)) : Plugin { ... }

Then when we want to test we pass in a dummy API that gives back raw JSON.

chris-addison commented 6 years ago

Yeah, I can do that tomorrow. That's a much better idea.

djdupre commented 6 years ago

I'll do it for the Google Code plugin

chris-addison commented 6 years ago

Should we make a general api interface, or one for each plugin?

djdupre commented 6 years ago

I think each plugin may need its own unique api interface. For example Google Code needs a fetchIssuesPage function but other plugins probably do not.

chris-addison commented 6 years ago

That's true. Then, specific for each plugin it is.

chris-addison commented 6 years ago

I've finished porting the code. Feel free to take a look!