public void Set_ValueIsntNull_CalledSetXml()
        {
            //Arrange
            Mock.Arrange(() => _xmlRepository.SetXml(
                             Arg.Matches <string>(path => path.StartsWith(Path)),
                             Value))
            .MustBeCalled();
            Mock.Arrange(() => _files.AddBrowseFile(Arg.AnyString, out _settingsFileInfo)).DoNothing();
            Mock.Arrange(() => _manager.GetSettingsFiles(0, out _files));

            //Act
            CreateController().Set(Value);

            //Assert
            Mock.AssertAll(_xmlRepository);
        }
Example #2
0
        private static IVsProfileSettingsFileInfo GetProfileSettingsFileInfo(string importFilePath)
        {
            IVsProfileDataManager vsProfileDataManager = (IVsProfileDataManager)Package.GetGlobalService(typeof(SVsProfileDataManager));

            vsProfileDataManager.GetSettingsFiles(uint.MaxValue, out IVsProfileSettingsFileCollection vsProfileSettingsFileCollection);
            vsProfileSettingsFileCollection.AddBrowseFile(importFilePath, out IVsProfileSettingsFileInfo profileSettingsFileInfo);
            return(profileSettingsFileInfo);
        }
        public void Set(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException("value");
            }

            IVsProfileSettingsFileInfo       settingsFileInfo;
            IVsProfileSettingsFileCollection files;
            IVsProfileSettingsTree           sets;

            _xmlRepository.SetXml(_fullPath, value);
            _manager.GetSettingsFiles(0, out files);
            files.AddBrowseFile(_fullPath, out settingsFileInfo);
            settingsFileInfo.GetSettingsForImport(out sets);
            _manager.ImportSettings(sets, out _errorInformation);
        }