public void ConstructorTestBadPathTest() { FileNotFoundException expected = null; try { WinCEInstallerFile file = new WinCEInstallerFile("\\Windows\\NoExistentfile.cab"); } catch (FileNotFoundException ex) { expected = ex; } Assert.IsNotNull(expected); }
public void ConstructorTestEmptyPathTest() { ArgumentException expected = null; try { WinCEInstallerFile file = new WinCEInstallerFile(string.Empty); } catch (ArgumentException ex) { expected = ex; } Assert.IsNotNull(expected); }
public void ConstructorTestInvalidCABTest() { InvalidArchiveException expected = null; string target = Path.Combine(TestContext.TestDeploymentDir, "invalid.cab"); using (StreamWriter writer = File.CreateText(target)) { writer.Write("This is not really a CAB file"); } try { WinCEInstallerFile file = new WinCEInstallerFile(target); } catch (InvalidArchiveException ex) { expected = ex; } Assert.IsNotNull(expected); }