NicholasTD07/SwiftDailyAPI

`DailyStore` phase one

Closed this issue · 5 comments

Store takes a APIType, easier to inject despondency, easier to test.

thought:
Make a protocol for DailyAPI which uses associated type to define handlers
DailyStore conforms to protocol.

A list of commits in feature/DailyStore-take-1

  • Add DailyInMemoryStore, not happy with it 376eedc
  • Use associated type in protocol DailyAPIType 801d88c
  • Add public init for all models cebbf19
  • Make DailyAPIType class only 8a32fb3
  • Extract protocol: DailyAPIType adc207f

From commit 376eedc: Add DailyInMemoryStore, not happy with it

Mainly because of the way it is tested.
The test/code radio is just so high... It looks so cumbersome...

Is there something that I am doing wrong?
Maybe it's because I don't know how to implement store.
I will spike it first and then add the spec for its behaviour.

PS.

Well not a fully implemented DailyInMemStore yet.

  • add spec for when there's something in store

Commits in feature/Daily-Store-take-2:

  • testable(non-private) properties to be tested 67ddbf6
  • Extract timeout in expect.toEventuallyNot to a variable 015d660
  • Xcode 7 + Swift 2 = AWESOME! (testable) f635059
  • Update for Swift 2.0 YEAH!!!!1! 5014eb4
  • Add DailyInMemoryStore with latestDaily, daily and news bb84bef

InMemStore is complete now, well, for major stuff(Daily, News).