async Task CanConstructStoragePasswordCollection() { var feed = await TestAtomFeed.ReadFeed(Path.Combine(TestAtomFeed.Directory, "StoragePasswordCollection.GetAsync.xml")); using (var context = new Context(Scheme.Https, "localhost", 8089)) { var expectedNames = new string[] { ":foobar:", "splunk.com:foobar:", "splunk\\:com:foobar:" }; var passwords = new StoragePasswordCollection(context, feed); Assert.Equal(expectedNames, from password in passwords select password.Title); Assert.Equal(expectedNames.Length, passwords.Count); CheckCommonProperties("passwords", passwords); for (int i = 0; i < passwords.Count; i++) { var entry = feed.Entries[i]; var password = passwords[i]; CheckStoragePassword(entry, password); } } }
/// <summary> /// Asynchronously retrieves a collection of storage passwords. /// </summary> /// <returns> /// An object representing the collection of storage passwords retrieved. /// </returns> /// <remarks> /// This method uses the <a href="http://goo.gl/XhebMI">GET /// storage/passwords</a> endpoint to construct the <see cref= /// "StoragePasswordCollection"/> it returns. /// </remarks> public async Task<StoragePasswordCollection> GetStoragePasswordsAsync(StoragePasswordCollectionArgs args = null) { var resource = new StoragePasswordCollection(this.Context, this.Namespace, args); await resource.GetAsync(); return resource; }