Ejemplo n.º 1
0
		public WeSayWordsProject()
		{
			_addins = AddinSet.Create(GetAddinNodes, LocateFile);
			_optionLists = new Dictionary<string, OptionsList>();
			BackupMaker = new ChorusBackupMaker();

		}
Ejemplo n.º 2
0
			public BackupScenario(string testName)
			{
				_projDir = new ProjectDirectorySetupForTesting("");

				_backupMaker = new ChorusBackupMaker();
				_backupDir = new TemporaryFolder(testName);

				_backupMaker.PathToParentOfRepositories = _backupDir.FolderPath;

			}
Ejemplo n.º 3
0
//        //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);
		}
Ejemplo n.º 4
0
		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);
				}

			}
		}