public async Task WhenUserNotInRole_ThenListNodeGroupsAsyncThrowsResourceAccessDeniedException( [Credential(Role = PredefinedRole.IapTunnelUser)] ResourceTask <ICredential> credential) { var adapter = new ComputeEngineAdapter(await credential); AssertEx.ThrowsAggregateException <ResourceAccessDeniedException>( () => adapter.ListNodeGroupsAsync( TestProject.ProjectId, CancellationToken.None).Wait()); }