Beispiel #1
0
        public override void OnInstallShortcut(ref ShortcutInstallInfo shortcutInfo)
        {
            // check to see that the file is in the expected list
            InstalledShortcutInfo info = new InstalledShortcutInfo(shortcutInfo.ShortcutLocation, shortcutInfo.ShortcutName, shortcutInfo.TargetLocation);

            bool found = false;

            foreach (InstalledShortcutInfo searchFor in m_testData.InstalledShortcuts)
            {
                // TODO: for now ignore date and flags, but these need to be validated in a future test
                if (info.CompareTo(searchFor) == 0)
                {
                    found = true;
                    // mark it as installed - we'll look at these later in the test to make sure everything was installed
                    searchFor.Installed = true;
                    break;
                }
            }

            if (!found)
            {
                Assert.Fail(string.Format("Shortcut '{0}' or one of its properties was unexpected", shortcutInfo.ShortcutName));
            }

            // don't call the base - we're just testing
        }
        public int CompareTo(InstalledShortcutInfo info)
        {
            int result = string.Compare(this.ShortcutName, info.ShortcutName, true);

            if (result != 0)
            {
                return(result);
            }

            result = string.Compare(this.ShortcutLocation, info.ShortcutLocation, true);
            if (result != 0)
            {
                return(result);
            }

            result = string.Compare(this.TargetLocation, info.TargetLocation, true);
            if (result != 0)
            {
                return(result);
            }

            return(0);
        }