[ios] Reset access token state after running tests

This commit is contained in:
Jason Wray
2019-02-18 17:34:33 -08:00
committed by Jason Wray
parent baaa9ca249
commit d0ffaa4245
5 changed files with 13 additions and 1 deletions

View File

@@ -9,6 +9,14 @@
@implementation MGLAttributionInfoTests
- (void)setUp {
[MGLAccountManager setAccessToken:@"pk.feedcafedeadbeefbadebede"];
}
- (void)tearDown {
[MGLAccountManager setAccessToken:nil];
}
- (void)testParsing {
static NSString * const htmlStrings[] = {
@"<a href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\">&copy; Mapbox</a> "
@@ -50,7 +58,7 @@
XCTAssertEqualObjects([infos[3] feedbackURLAtCenterCoordinate:mapbox zoomLevel:14],
[NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox#/77.63680/12.98108/14.00/0.0/0"]);
XCTAssertEqualObjects([infos[3] feedbackURLForStyleURL:styleURL atCenterCoordinate:mapbox zoomLevel:3.14159 direction:90.9 pitch:12.5],
[NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox&owner=mapbox&id=satellite-streets-v99&access_token&map_sdk_version=1.0.0#/77.63680/12.98108/3.14/90.9/13"]);
[NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox&owner=mapbox&id=satellite-streets-v99&access_token=pk.feedcafedeadbeefbadebede&map_sdk_version=1.0.0#/77.63680/12.98108/3.14/90.9/13"]);
}
- (void)testStyle {

View File

@@ -36,6 +36,7 @@ static MGLMapView *mapView;
+ (void)tearDown {
mapView = nil;
[MGLAccountManager setAccessToken:nil];
[super tearDown];
}

View File

@@ -57,6 +57,7 @@
self.renderFinishedExpectation = nil;
self.mapView = nil;
self.style = nil;
[MGLAccountManager setAccessToken:nil];
[super tearDown];
}

View File

@@ -58,6 +58,7 @@
- (void)tearDown {
self.styleLoadingExpectation = nil;
self.mapView = nil;
[MGLAccountManager setAccessToken:nil];
[super tearDown];
}

View File

@@ -19,6 +19,7 @@
- (void)tearDown {
self.mapView = nil;
[MGLAccountManager setAccessToken:nil];
[super tearDown];
}