mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-03-18 13:28:06 +00:00
Remove unused serializeToString
This commit is contained in:
@@ -4,6 +4,5 @@
|
||||
@interface BITTelemetryObject : NSObject <NSCoding>
|
||||
|
||||
- (NSDictionary *)serializeToDictionary;
|
||||
- (NSString *)serializeToString;
|
||||
|
||||
@end
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user