public WeSayWordsProject() { _addins = AddinSet.Create(GetAddinNodes, LocateFile); _optionLists = new Dictionary<string, OptionsList>(); BackupMaker = new ChorusBackupMaker(); }
public BackupScenario(string testName) { _projDir = new ProjectDirectorySetupForTesting(""); _backupMaker = new ChorusBackupMaker(); _backupDir = new TemporaryFolder(testName); _backupMaker.PathToParentOfRepositories = _backupDir.FolderPath; }
// //provide an IServiceProvider facade around our DI Container // public object GetService(Type serviceType) // { // return _container.Resolve(serviceType); // } private void LoadBackupPlan() { //what a mess. I hate .net new fangled xml stuff... XPathDocument projectDoc = GetConfigurationDoc(); XPathNavigator backupPlanNav = projectDoc.CreateNavigator(); backupPlanNav = backupPlanNav.SelectSingleNode("configuration/" + ChorusBackupMaker.ElementName); if (backupPlanNav == null) { //make sure we have a fresh copy with any defaults BackupMaker = new ChorusBackupMaker(); return; } XmlReader r = XmlReader.Create(new StringReader(backupPlanNav.OuterXml)); BackupMaker = ChorusBackupMaker.LoadFromReader(r); }
public void CanSerializeAndDeserializeSettings() { ChorusBackupMaker b = new ChorusBackupMaker(); b.PathToParentOfRepositories = @"z:\"; StringBuilder builder = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(builder)) { b.Save(writer); using (XmlReader reader = XmlReader.Create(new StringReader(builder.ToString()))) { ChorusBackupMaker loadedGuy = ChorusBackupMaker.LoadFromReader(reader); Assert.AreEqual(@"z:\", loadedGuy.PathToParentOfRepositories); } } }