private void RunCreationTest(IsoStorageConfigurationSource source) { string sourceFile = string.Empty; try { source.Add(SectionGenerator.GetSingleSection()); source.Save(); sourceFile = source.FullPath; // we should now have a file on the hdd with the settings we want. string sourceAsXml = XmlConfigurationSource.ToXml(source); // Now create a new instance so it can load the data. var newSource = new IsoStorageConfigurationSource(source.Scope, _fileName); string newSourceAsXml = XmlConfigurationSource.ToXml(newSource); Assert.Equal(sourceAsXml, newSourceAsXml); } finally { if (File.Exists(sourceFile)) { File.Delete(sourceFile); } } }
private void RunCreationTest( IsoStorageConfigurationSource source ) { string sourceFile = string.Empty; try { source.Add( SectionGenerator.GetSingleSection() ); source.Save(); sourceFile = source.FullPath; // we should now have a file on the hdd with the settings we want. string sourceAsXml = XmlConfigurationSource.ToXml( source ); // Now create a new instance so it can load the data. var newSource = new IsoStorageConfigurationSource( source.Scope, _fileName ); string newSourceAsXml = XmlConfigurationSource.ToXml( newSource ); Assert.Equal( sourceAsXml, newSourceAsXml ); } finally { if ( File.Exists( sourceFile ) ) { File.Delete( sourceFile ); } } }