Remove unused serializeToString

This commit is contained in:
Lukas Spieß
2016-03-17 19:16:08 +01:00
parent 44ad0da6dc
commit 41bda8ae43
3 changed files with 3 additions and 13 deletions

View File

@@ -4,6 +4,5 @@
@interface BITTelemetryObject : NSObject <NSCoding>
- (NSDictionary *)serializeToDictionary;
- (NSString *)serializeToString;
@end

View File

@@ -7,17 +7,6 @@
return [NSDictionary dictionary];
}
- (NSString *)serializeToString {
NSDictionary *dict = [self serializeToDictionary];
NSMutableString *jsonString;
NSError *error = nil;
NSData *json;
json = [NSJSONSerialization dataWithJSONObject:dict options:0 error:&error];
jsonString = [[NSMutableString alloc] initWithData:json encoding:NSUTF8StringEncoding];
NSString *returnString = [[jsonString stringByReplacingOccurrencesOfString:@"\"true\"" withString:@"true"] stringByReplacingOccurrencesOfString:@"\"false\"" withString:@"false"];
return returnString;
}
- (void)encodeWithCoder:(NSCoder *)coder {
}

View File

@@ -48,7 +48,9 @@
- (void)testRequestContainsDataItem {
BITEnvelope *testItem = [BITEnvelope new];
NSData *expectedBodyData = [[testItem serializeToString] dataUsingEncoding:NSUTF8StringEncoding];
NSData *expectedBodyData = [NSJSONSerialization dataWithJSONObject:[testItem serializeToDictionary]
options:0
error:nil];
NSURLRequest *testRequest = [_sut requestForData:expectedBodyData];
XCTAssertNotNil(testRequest);