Skip to content

Instantly share code, notes, and snippets.

View yonixw's full-sized avatar

Yehonatan Water Man yonixw

View GitHub Profile
@xaethos
xaethos / gist:3792258
Created September 27, 2012 05:06
Mocking HttpURLConnection
public class URLRequestUnit extends InstrumentationTestCase
{
private static final String API_URL =
"http://www.example.com/api/users";
public void testHttpOkay() throws Exception {
MockURLStreamHandler handler = new MockURLStreamHandler();
URL.setURLStreamHandlerFactory(handler);
UsersRequest request = new UsersRequest();
@axiixc
axiixc / AXMutableOrderedDictionary.h
Created April 29, 2011 18:06
A mutable ordered dictionary collection for Objective-C.
@interface AXMutableOrderedDictionary : NSMutableDictionary <NSMutableCopying> {
@private
NSMutableArray * _keys;
NSMutableDictionary * _dict;
}
+ (id)newWithCapacity:(NSUInteger)initialCapacity;
+ (id)newWithOrderedDictionary:(AXMutableOrderedDictionary *)otherDictionary;
+ (id)newWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;