batoulapps / QamarDeen

Islamic Activity Tracker
MIT License
18 stars 7 forks source link

Data model integration #8

Closed Mazyod closed 7 years ago

Mazyod commented 7 years ago

The idea I'm going for is to generate some data using the legacy app, then use the data file to write tests that ensure the core data model works.

Mazyod commented 7 years ago

Opening a PR to promote progressive code review. Please don't merge until all checkmarks are done.

Mazyod commented 7 years ago

@z3bi As much as I would like to write tests, I think I can only commit an average of 2-3 hours daily, so will instead try to make progress, especially given how simple the application is.

Mazyod commented 7 years ago

Added AyahsCount tests ✨

Mazyod commented 7 years ago

There might be a off-by-one error.. Per unit test, I assumed if start is 5 and end is 25, that makes 20 Ayahs. But, after thinking a bit more about it, if the user reads a full Surah, so it becomes 1 to x, the total should be x - 1 + 1, which is just x.

I will push a fix soon.