Added further testing for #66

pull/119/head
dahall 2020-01-09 09:41:01 -07:00
parent 095157dbc3
commit d284fb6f69
2 changed files with 20 additions and 0 deletions

View File

@ -94,6 +94,25 @@ namespace Vanara.Windows.Shell.Tests
Assert.That(() => new ShellFolder(KNOWNFOLDERID.FOLDERID_Windows).EnumerateChildren((FolderItemFilter)0x80000), Is.Empty);
}
[Test]
public void GetDisplayNameTest()
{
using (var i = new ShellFolder(PInvoke.Tests.TestCaseSources.TempDir))
{
Assert.That(i.GetDisplayName(ShellItemDisplayString.FileSysPath), Is.EqualTo(PInvoke.Tests.TestCaseSources.TempDir).IgnoreCase);
foreach (ShellItemDisplayString e in Enum.GetValues(typeof(ShellItemDisplayString)))
Assert.That(() => TestContext.WriteLine($"{e}={i.GetDisplayName(e)}"), Throws.Nothing);
Assert.That(i.GetDisplayName((ShellItemDisplayString)0x8fffffff), Is.EqualTo(i.GetDisplayName(0)));
}
using (var i = new ShellFolder(KNOWNFOLDERID.FOLDERID_DocumentsLibrary))
{
foreach (ShellItemDisplayString e in Enum.GetValues(typeof(ShellItemDisplayString)))
Assert.That(() => TestContext.WriteLine($"{e}={i.GetDisplayName(e)}"), Throws.Nothing);
Assert.That(i.GetDisplayName((ShellItemDisplayString)0x8fffffff), Is.EqualTo(i.GetDisplayName(0)));
}
}
[Test]
public void GetObjectTest()
{

View File

@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>