예제 #1
0
        public override void OnInstallRegValue(ref RegistryInstallInfo registryInfo)
        {
            // check to see that the file is in the expected list
            InstalledRegInfo info = new InstalledRegInfo(registryInfo.KeyName, registryInfo.ValueName, registryInfo.ValueKind);

            bool found = false;

            foreach (InstalledRegInfo searchFor in m_testData.InstalledRegKeys)
            {
                // TODO: for now ignore date and flags, but these need to be validated in a future test
                if (info.CompareTo(searchFor, true, true) == 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("Value '{0}' or one of its properties was unexpected", registryInfo.ValueName));
            }

            // don't call the base - we're just testing
        }
예제 #2
0
        public int CompareTo(InstalledRegInfo info, bool ignoreNoClobber, bool ignoreData)
        {
            int result = string.Compare(this.KeyName, info.KeyName, true);

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

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

            result = this.ValueKind.CompareTo(info.ValueKind);
            if (result != 0)
            {
                return(result);
            }

            if (!ignoreData)
            {
                // todo:
                throw new NotSupportedException();
            }

            if (!ignoreNoClobber)
            {
                result = this.NoClobber.CompareTo(info.NoClobber);
                if (result != 0)
                {
                    return(result);
                }
            }

            return(0);
        }