68 lines
1.5 KiB
Objective-C
68 lines
1.5 KiB
Objective-C
//
|
|
// FMC_Planner_2Tests.m
|
|
// FMC Planner 2Tests
|
|
//
|
|
// Created by Kilian Hofmann on 19.03.16.
|
|
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
|
//
|
|
|
|
#import "NavDataParser.h"
|
|
#import <XCTest/XCTest.h>
|
|
|
|
@interface FMC_Planner_2Tests : XCTestCase {
|
|
NavDataParser *parser;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation FMC_Planner_2Tests
|
|
|
|
- (void)setUp
|
|
{
|
|
[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];
|
|
}
|
|
}
|
|
|
|
- (void)tearDown
|
|
{
|
|
// Put teardown code here. This method is called after the invocation of
|
|
// each test method in the class.
|
|
[super tearDown];
|
|
}
|
|
|
|
#pragma mark - NavData
|
|
|
|
- (void)testWaypoint
|
|
{
|
|
XCTAssertTrue([parser findWaypoint:@"DKB"].count > 0);
|
|
XCTAssertTrue([parser findWaypoint:@"NNNN"].count == 0);
|
|
}
|
|
|
|
- (void)testAirway
|
|
{
|
|
XCTAssertTrue([parser findAirway:@"T104"].count > 0);
|
|
XCTAssertTrue([parser findAirway:@"T104T"].count == 0);
|
|
}
|
|
|
|
- (void)testWaypointOnAirway
|
|
{
|
|
XCTAssertTrue([parser findWaypoint:@"DKB" onAirway:@"T104"].count > 0);
|
|
XCTAssertTrue([parser findWaypoint:@"DKB" onAirway:@"T702"].count == 0);
|
|
}
|
|
|
|
- (void)testCrosspoint
|
|
{
|
|
XCTAssertTrue(
|
|
[[parser findCrosspointBetween:@"T104" and:@"T702" withStart:@"DKB"]
|
|
.firstObject isEqualToString:@"WLD"]);
|
|
XCTAssertTrue([parser findCrosspointBetween:@"T104"
|
|
and:@"A1"
|
|
withStart:@"DKB"] == nil);
|
|
}
|
|
|
|
@end
|