Example #1
0
        public void TestGetUserCredential()
        {
            IIdentityProvider provider = Bootstrapper.CreateIdentityProvider();
            User user = provider.GetUserByName(Bootstrapper.Settings.TestIdentity.Username);
            IEnumerable <UserCredential> credentials = provider.ListUserCredentials(user.Id);

            Assert.IsNotNull(credentials);
            Assert.IsTrue(credentials.Any());

            foreach (UserCredential credential in credentials)
            {
                UserCredential value = provider.GetUserCredential(user.Id, credential.Name);
                Assert.AreEqual(credential.Username, value.Username);
                Assert.AreEqual(credential.Name, value.Name);
                Assert.AreEqual(credential.APIKey, value.APIKey);
            }

            Console.WriteLine(JsonConvert.SerializeObject(credentials, Formatting.Indented));
        }