Completed unit tests (non-functional) for appmgmt.h

pull/83/head
David Hall 2019-08-04 16:58:22 -06:00
parent 6f6b0e2831
commit 46fe06ce41
1 changed files with 12 additions and 3 deletions

View File

@ -10,7 +10,7 @@ namespace Vanara.PInvoke.Tests
[TestFixture()] [TestFixture()]
public class AppMgmtTests public class AppMgmtTests
{ {
// [Test] TODO: Figure out how to test [Test] // TODO: Figure out how to test
public void GetLocalManagedApplicationsTest() public void GetLocalManagedApplicationsTest()
{ {
var l = GetLocalManagedApplications(true).ToArray(); var l = GetLocalManagedApplications(true).ToArray();
@ -19,7 +19,7 @@ namespace Vanara.PInvoke.Tests
TestContext.WriteLine("; ", l.Select(i => i.pszDeploymentName)); TestContext.WriteLine("; ", l.Select(i => i.pszDeploymentName));
} }
// [Test] TODO: Figure out how to test [Test] // TODO: Figure out how to test
public void GetManagedApplicationCategoriesTest() public void GetManagedApplicationCategoriesTest()
{ {
var l = GetManagedApplicationCategories().ToArray(); var l = GetManagedApplicationCategories().ToArray();
@ -27,12 +27,21 @@ namespace Vanara.PInvoke.Tests
Assert.That(l, Is.Not.Empty); Assert.That(l, Is.Not.Empty);
} }
// [Test] TODO: Figure out how to test [Test] // TODO: Figure out how to test
public void GetManagedApplicationsTest() public void GetManagedApplicationsTest()
{ {
var l = GetManagedApplications(null).ToArray(); var l = GetManagedApplications(null).ToArray();
TestContext.WriteLine("; ", l.Select(i => i.pszPackageName)); TestContext.WriteLine("; ", l.Select(i => i.pszPackageName));
Assert.That(l, Is.Not.Empty); Assert.That(l, Is.Not.Empty);
} }
[Test]
public void InstallApplicationTest()
{
var id = new INSTALLDATA { Type = INSTALLSPECTYPE.FILEEXT };
var pExt = new SafeCoTaskMemString("*.jpg");
id.Spec = new INSTALLSPEC { FileExt = (IntPtr)pExt };
Assert.That(InstallApplication(id), ResultIs.Successful);
}
} }
} }