public async Task TestGetApiKeys() { var firstUser = _extendedUserStore.Users.First(); Assert.AreEqual(await _extendedManager.GetApiKeysAsync(firstUser.Id), firstUser.ApiKeys); Assert.ThrowsAsync <InvalidOperationException>(async() => await _extendedManager.GetApiKeysAsync(-1)); }
public async Task TestNotUsingApiKeys() { var manager = new ExtendedUserManager <ExtendedUser, int>(_extendedUserStore); Assert.IsFalse(manager.SupportsUserApiKey); Assert.ThrowsAsync <NotSupportedException>(async() => await manager.FindByPublicKeyAsync("")); Assert.ThrowsAsync <NotSupportedException>(async() => await manager.CheckApiKeyAsync("")); Assert.ThrowsAsync <NotSupportedException>(async() => await manager.CheckApiKeyAsync("", "")); Assert.ThrowsAsync <NotSupportedException>(async() => await manager.GetApiKeysAsync(0)); Assert.ThrowsAsync <NotSupportedException>(async() => await manager.RemoveApiKeyAsync(null, null)); Assert.ThrowsAsync <NotSupportedException>(async() => await manager.CreateApiKeyAsync(null)); }