more tests
This commit is contained in:
@@ -6,11 +6,14 @@
|
||||
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DropboxV2ObjC.h"
|
||||
#import "NavDataParser.h"
|
||||
#import "SharedDeclerations.h"
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
@interface FMC_Planner_2Tests : XCTestCase {
|
||||
NavDataParser *parser;
|
||||
DropboxV2ObjC *dbClient;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -22,9 +25,8 @@
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each
|
||||
// test method in the class.
|
||||
if (parser == nil) {
|
||||
parser = [[NavDataParser alloc] init];
|
||||
}
|
||||
parser = [[NavDataParser alloc] init];
|
||||
dbClient = [[DropboxV2ObjC alloc] init];
|
||||
}
|
||||
|
||||
- (void)tearDown
|
||||
@@ -47,6 +49,8 @@
|
||||
{
|
||||
XCTAssertTrue([parser findAirway:@"T104"].count > 0);
|
||||
XCTAssertTrue([parser findAirway:@"T104T"].count == 0);
|
||||
XCTAssertTrue(
|
||||
[[parser findAirway:@"DIRECT"].firstObject isEqualToString:@"OK"]);
|
||||
}
|
||||
|
||||
- (void)testWaypointOnAirway
|
||||
@@ -68,4 +72,50 @@
|
||||
withStart:@"DKB"] == nil);
|
||||
}
|
||||
|
||||
- (void)testPathContent
|
||||
{
|
||||
[dbClient contentsOfPath:nil
|
||||
completion:^(NSArray *data, BOOL success) {
|
||||
if (success) {
|
||||
NSMutableArray *temp = [[NSMutableArray alloc] init];
|
||||
for (NSDictionary *dict in data) {
|
||||
[temp addObject:[dict valueForKey:@"name"]];
|
||||
}
|
||||
XCTAssertTrue([temp containsObject:@"TEST.txt"]);
|
||||
}
|
||||
}
|
||||
presenter:nil];
|
||||
}
|
||||
|
||||
- (void)testDownload
|
||||
{
|
||||
if ([[NSFileManager defaultManager]
|
||||
fileExistsAtPath:[SharedDeclerations
|
||||
savePathForFile:@"TEST.txt"]]) {
|
||||
[[NSFileManager defaultManager]
|
||||
removeItemAtPath:[SharedDeclerations savePathForFile:@"TEST.txt"]
|
||||
error:nil];
|
||||
}
|
||||
[dbClient downloadFromDropbox:@[ @"TEST.txt" ]
|
||||
presenter:nil
|
||||
completion:^(BOOL success) {
|
||||
if (success) {
|
||||
XCTAssertTrue([[NSFileManager defaultManager]
|
||||
fileExistsAtPath:
|
||||
[SharedDeclerations
|
||||
savePathForFile:@"TEST.txt"]]);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testUpload
|
||||
{
|
||||
[dbClient
|
||||
uploadToDropbox:@[ [SharedDeclerations savePathForFile:@"TEST.txt"] ]
|
||||
presenter:nil
|
||||
completion:^(BOOL success) {
|
||||
XCTAssertTrue(success);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user