using System; using System.Collections.Generic; using System.Text; using System.Xml; using NUnit.Framework; namespace ChadSoft.Utils.Configy.Tests { [TestFixture] public class ConfigMergerTests { [Test] public void MergeAppSettings() { XmlDocument expected = new XmlDocument(); expected.LoadXml(""); XmlDocument first = new XmlDocument(); XmlDocument second = new XmlDocument(); first.LoadXml(""); second.LoadXml(""); XmlDocument actual = ConfigurationMerger.Merge(first, second); Assert.AreEqual(expected.OuterXml, actual.OuterXml); } [Test] public void MergeConnectionStrings() { XmlDocument expected = new XmlDocument(); expected.LoadXml(""); XmlDocument first = new XmlDocument(); XmlDocument second = new XmlDocument(); first.LoadXml(""); second.LoadXml(""); XmlDocument actual = ConfigurationMerger.Merge(first, second); Assert.AreEqual(expected.OuterXml, actual.OuterXml); } [Test] [ExpectedException(typeof(NotSupportedException))] public void MergeUnsupportedConfiguration() { XmlDocument first = new XmlDocument(); XmlDocument second = new XmlDocument(); first.LoadXml(""); second.LoadXml(""); // Throws exception ConfigurationMerger.Merge(first, second); } } }