Exemplo n.º 1
0
        public void TestGetInstalledProgramByName_Chrome()
        {
            string           name    = "Google Chrome";
            InstalledProgram product = InstalledProgramsHelper.GetInstalledProgramByName(name);
            bool             actual  = product.DisplayName.Contains(name);

            Assert.AreEqual(true, actual);
        }
Exemplo n.º 2
0
        public void TestMSIProductCodeConversion_No_Such_Package_Name()
        {
            string uninstallerCode = "NO_SUCH_CODE";
            string expected        = "";
            string actual          = InstalledProgramsHelper.GetInstallerKeyNameFromGuid(uninstallerCode);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void TestMSIProductCodeConversion_Shorter_Name()
        {
            string uninstallerCode = "{00EC8ABC";
            string expected        = "";
            string actual          = InstalledProgramsHelper.GetInstallerKeyNameFromGuid(uninstallerCode);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void TestMSIProductCodeConversion()
        {
            string uninstallerCode = "{00EC8ABC-3C5A-40F8-A8CB-E7DCD5ABFA05}";
            string expected        = "CBA8CE00A5C38F048ABC7ECD5DBAAF50";
            string actual          = InstalledProgramsHelper.GetInstallerKeyNameFromGuid(uninstallerCode);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 5
0
        public void TestGetInstalledProgramByName_Regex_VisualStudio()
        {
            Regex name = new Regex("[M|m]icrosoft [V|v]isual [S|s]tudio");

            InstalledProgram product = InstalledProgramsHelper.GetInstalledProgramByName(name);
            bool             actual  = product != null;

            Assert.AreEqual(true, actual);
        }
Exemplo n.º 6
0
        public void Test_GetWindowsUpdates()
        {
            string updates = InstalledProgramsHelper.GetWindowsUpdatesInfo();

            Assert.AreEqual(true, updates.Contains("Hotfix(s) Installed"));
        }