Example #1
0
        public void StartInstalling_should_install_x86_com_component()
        {
            using (var classesRootKey = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry32))
            {
                try
                {
                    // Arrange
                    var fixture = new Fixture().Customize(new AutoMoqCustomization());

                    var profPath = AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\x86\Urasandesu.Prig.dll");

                    var regsvr32Executor = fixture.NewRegsvr32Executor();


                    // Act
                    var result = regsvr32Executor.StartInstalling(profPath);


                    // Assert
                    using (var inprocServer32Key = classesRootKey.OpenSubKey(ProfilerLocation.InprocServer32Path))
                    {
                        Assert.AreEqual(inprocServer32Key.GetValue(null), profPath);
                    }
                }
                finally
                {
                    try
                    {
                        classesRootKey.DeleteSubKey(ProfilerLocation.InprocServer32Path);
                    }
                    catch
                    { }
                }
            }
        }
Example #2
0
        public void StartInstalling_should_install_x64_com_component()
        {
            using (var classesRootKey = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry64))
            {
                try
                {
                    // Arrange
                    var fixture = new Fixture().Customize(new AutoMoqCustomization());

                    var profPath = AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\x64\Urasandesu.Prig.dll");

                    var regsvr32Executor = fixture.NewRegsvr32Executor();


                    // Act
                    var result = regsvr32Executor.StartInstalling(profPath);


                    // Assert
                    using (var inprocServer32Key = classesRootKey.OpenSubKey(ProfilerLocation.InprocServer32Path))
                    {
                        Assert.AreEqual(inprocServer32Key.GetValue(null), profPath);
                    }
                }
                finally
                {
                    try
                    {
                        classesRootKey.DeleteSubKey(ProfilerLocation.InprocServer32Path);
                    }
                    catch
                    { }
                }
            }
        }