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 CoreData; | |
#import <Foundation/Foundation.h> | |
@interface NSManagedObject (CALDeleteAll) | |
/** | |
* Deletes all instances of this object from CoreData (may take a while) | |
*/ | |
+ (void)cal_deleteAll:(NSManagedObjectContext *)context; |
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
In Android Studio 1.0 the scheme has changed a little bit. | |
The path to a unit test source file should be (app)/src/androidTest/java/com/mycompany/myapp/HelloWorldTest.java | |
Here's how I set up Unit Tests in a new Android Studio project: | |
- Open app in Android Studio. | |
- Set the Project explorer (left hand window) to display 'Project' mode. Tap the little drop-down at the top left and select 'Project'. | |
- Right click the 'src' directory, 'New -> Directory'. | |
- Call new directory androidTest |
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
[ | |
{ | |
"name":"Alice", | |
"age": 64 | |
}, | |
{ | |
"name":"Bob", | |
"age": 12 | |
}, | |
{ |
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 <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface JSONFromBundle : NSObject | |
// Also removes nulls | |
+ (id)nameNoExtension:(NSString *)name; | |
@end |
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 <XCTest/XCTest.h> | |
// Inherit from this to automatically create and delete [RLMRealm defaultRealm] files between tests | |
@interface RealmTestCase : XCTestCase | |
@end |
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
# Put then name of your main app's target here. | |
target 'MainApp' do | |
pod 'Realm' | |
pod 'NSDate+Calendar' | |
pod 'Realm+JSON' | |
# and any other dependencies | |
end | |
# Put the name of the Unit Testing Target here | |
target 'MainAppTests' do |
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 Foundation; | |
// In-place removal of [NSNull null] values | |
// Useful when importing into Realm | |
@interface NSMutableDictionary (BVMNullReplacement) | |
- (void)bvm_removeNulls; | |
@end | |
// In-place removal of [NSNull null] values | |
// Useful when importing into Realm |
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 <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@import CoreData; | |
typedef NS_ENUM(NSUInteger, FetchResultControllerMode) { | |
FetchResultsTableViewUpdaterModeMultipleSection, | |
FetchResultsTableViewUpdaterModeSingleFixedSection | |
}; |
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 <XCTest/XCTest.h> | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
/** | |
Inherit XCTest TestCase classes from this to setup and tearDown a SQLite-backed | |
MagicalRecord core data stack on each test. | |
The SQLite file itself will be deleted between runs. |
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
-com.apple.CoreData.SQLiteIntegrityCheck | |
1 | |
-com.apple.CoreData.ThreadingDebug | |
3 | |
-com.apple.CoreData.SyntaxColoredLogging | |
1 | |
-com.apple.CoreData.SQLDebug | |
1 |