public void GetImageTest2() { var f = new ShellFolder(KNOWNFOLDERID.FOLDERID_AppsFolder); foreach (var i in f.EnumerateChildren(FolderItemFilter.NonFolders | FolderItemFilter.Folders)) { Assert.That(() => i.GetImage(new Size(32, 32), ShellItemGetImageOptions.BiggerSizeOk), Throws.Nothing); } }
public void EnumerateTest() { Assert.That(() => { using (var ie1 = new ShellFolder(KNOWNFOLDERID.FOLDERID_Windows)) { var ie2 = ie1.EnumerateChildren(FolderItemFilter.NonFolders); Assert.That(ie1.Intersect(ie2).OrderBy(s => s.Name), Is.EquivalentTo(ie2.OrderBy(s => s.Name))); } using var d = new ShellFolder(@"C:\"); using var libs = (ShellFolder)d["Temp"]; Assert.That(libs, Is.Not.Null.And.InstanceOf <ShellFolder>()); using var lnk = libs["Test.lnk"]; Assert.That(lnk, Is.Not.Null.And.InstanceOf <ShellLink>()); }, Throws.Nothing); Assert.That(() => new ShellFolder(KNOWNFOLDERID.FOLDERID_Windows).EnumerateChildren((FolderItemFilter)0x80000), Is.Empty); }