public void GetClientAccessTokenCancellationTokenOverloadWithNullScopeDoesNotThrowException() { // Arrange var accessTokenClient = new AccessTokenClient(ServerConfiguration); string nullScope = null; // Act // Assert Assert.DoesNotThrow(() => accessTokenClient.GetClientAccessToken(nullScope, CancellationToken.None)); }
public void GetClientAccessTokenCancellationTokenOverloadWithInvalidScopeReturnsAccessToken() { // Arrange var accessTokenClient = new AccessTokenClient(ServerConfiguration); // Act var task = accessTokenClient.GetClientAccessToken("invalid client scope", CancellationToken.None); // Assert Assert.Throws <AggregateException>(() => task.Wait()); }
public void GetClientAccessTokenCancellationTokenOverloadReturnsAccessToken() { // Arrange var accessTokenClient = new AccessTokenClient(ServerConfiguration); // Act var task = accessTokenClient.GetClientAccessToken(ClientScope, CancellationToken.None); task.Wait(); // Assert Assert.NotNull(task.Result); }
public void GetClientAccessTokenCancellationTokenOverloadWithInvalidScopeReturnsAccessToken() { // Arrange var accessTokenClient = new AccessTokenClient(ServerConfiguration); // Act var task = accessTokenClient.GetClientAccessToken("invalid client scope", CancellationToken.None); // Assert Assert.Throws<AggregateException>(() => task.Wait()); }