Esempio n. 1
0
        public void ConstructorTestBadPathTest()
        {
            FileNotFoundException expected = null;

            try
            {
                WinCEInstallerFile file = new WinCEInstallerFile("\\Windows\\NoExistentfile.cab");
            }
            catch (FileNotFoundException ex)
            {
                expected = ex;
            }

            Assert.IsNotNull(expected);
        }
Esempio n. 2
0
        public void ConstructorTestEmptyPathTest()
        {
            ArgumentException expected = null;

            try
            {
                WinCEInstallerFile file = new WinCEInstallerFile(string.Empty);
            }
            catch (ArgumentException ex)
            {
                expected = ex;
            }

            Assert.IsNotNull(expected);
        }
Esempio n. 3
0
        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);
        }