michaelarmstrong / SuperRecord

A small set of utilities to make working with CoreData and Swift a bit easier.
MIT License
366 stars 27 forks source link

Add Sample Model with UnitTest #3

Closed PGLongo closed 10 years ago

PGLongo commented 10 years ago

Hi,

I have created a sample test that could be a good starting point.

Changes:

  1. Created sample Model, with two entities: Pokemon and Type.
  2. Created sample test
  3. Changed extensions visibility to public, to allow framework use.
  4. Added completionHandler (default values is nil) in findAllWithPredicate and findFirstOrCreateWithPredicate. The completion handler is necessary to allow async test and it should be added to all the function that call findAllWithPredicate or findFirstOrCreateWithPredicate
  5. Added SuperRecordTestsTestCase : XCTestCase, ovveriding setUp function initializing the test managedObjectContext.
michaelarmstrong commented 10 years ago

looking at this one too, can you merge develop into it, thanks :)

michaelarmstrong commented 10 years ago

great work, good to see some unit tests, that was a high priority on my todo list.

PGLongo commented 10 years ago

Ok, I will merge develop and add more tests.

PGLongo commented 10 years ago

Later today I will add some tests

PGLongo commented 10 years ago

Added tests, documentation and pragma mark for:

  1. createNewEntity
  2. findFirstOrCreateWithAttribute
  3. findFirstOrCreateWithPredicate
michaelarmstrong commented 10 years ago

Great work :) i'll be pushing some changes to the managedObjectContext stack soon.