Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Commit 108d5f1

Browse files
author
Vikas Dadheech
committed
Resolved review comments
# Spelling mistake in MSAuthenticationProvider # Added stub for MSGraphMiddleware's setNext method in MSURLSessionManager and Unit test for the same
1 parent 5d974e0 commit 108d5f1

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

MSGraphCoreSDK/MSGraphCoreSDK/Authentication/MSAuthenticationProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ typedef void(^MSAuthenticationCompletion)(NSMutableURLRequest *request, NSError
1414
@protocol MSAuthenticationProvider <NSObject>
1515

1616
/**
17-
Gets the access token. This method should be implmented by a class which should provide the capability of providing the access token.
17+
Gets the access token. This method should be implemented by a class which should provide the capability of providing the access token.
1818
@param completion The completion handler to be called when access token or an error can be returned.
1919
*/
2020

MSGraphCoreSDK/MSGraphCoreSDK/Middleware/Implementations/HTTPProvider/MSURLSessionManager.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,7 @@ - (void)execute:(MSURLSessionTask *)task withCompletionHandler:(HTTPRequestCompl
243243

244244
- (void)setNext:(id<MSGraphMiddleware>)nextMiddleware
245245
{
246-
if(_nextMiddleware)
247-
{
248-
[nextMiddleware setNext:_nextMiddleware];
249-
}
250-
_nextMiddleware = nextMiddleware;
246+
NSAssert(NO, @"This class is last node of middleware chain. So can not set any next middleware after this.");
251247
}
252248

253249
@end

MSGraphCoreSDK/MSGraphCoreSDKTests/Middleware/Implementations/MSURLSessionManagerTests.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,7 @@ - (void)testWillPerformRedirect {
234234

235235
- (void)testSetNext{
236236
id<MSGraphMiddleware> tempMiddleware = OCMProtocolMock(@protocol(MSGraphMiddleware));
237-
[_sessionManager setNext:tempMiddleware];
238-
XCTAssertEqualObjects(tempMiddleware, _sessionManager.nextMiddleware);
239-
id<MSGraphMiddleware> tempMiddleware1 = OCMProtocolMock(@protocol(MSGraphMiddleware));
240-
[_sessionManager setNext:tempMiddleware1];
241-
XCTAssertEqualObjects(_sessionManager.nextMiddleware, tempMiddleware1);
237+
XCTAssertThrows([_sessionManager setNext:tempMiddleware]);
242238
}
243239

244240
#pragma mark - Middleware execution

0 commit comments

Comments
 (0)