public void ToXmlExpectedInvokesToXmlForEachProperty()
        {
            var config = new Configuration.Settings.Configuration("localhost");
            var result = config.ToXml();

            var properties = config.GetType().GetProperties();

            foreach (var property in properties)
            {
                var value = property.GetValue(config);

                Version      version;
                SettingsBase settings;

                if ((settings = value as SettingsBase) != null)
                {
                    var expected = settings.ToXml().ToString(SaveOptions.DisableFormatting);

                    var actual = result.Element(settings.SettingName).ToString(SaveOptions.DisableFormatting);

                    Assert.AreEqual(expected, actual);
                }
                else if ((version = value as Version) != null)
                {
                    var actual   = result.AttributeSafe(property.Name);
                    var expected = version.ToString(2);
                    Assert.AreEqual(expected, actual);
                }
            }
        }
        //
        // Static helpers
        //


        #region ValidateInitializesAllProperties

        static void ValidateInitializesAllProperties(Configuration.Settings.Configuration config)
        {
            var properties = config.GetType().GetProperties();

            foreach (var value in properties.Select(property => property.GetValue(config)))
            {
                Assert.IsNotNull(value);
            }
        }
        public void ToXmlExpectedInvokesToXmlForEachProperty()
        {
            var config = new Configuration.Settings.Configuration("localhost");
            var result = config.ToXml();

            var properties = config.GetType().GetProperties();
            foreach(var property in properties)
            {
                var value = property.GetValue(config);

                Version version;
                Configuration.Settings.SettingsBase settings;

                if((settings = value as Configuration.Settings.SettingsBase) != null)
                {
                    var expected = settings.ToXml().ToString(SaveOptions.DisableFormatting);
                    // ReSharper disable PossibleNullReferenceException
                    var actual = result.Element(settings.SettingName).ToString(SaveOptions.DisableFormatting);
                    // ReSharper restore PossibleNullReferenceException
                    Assert.AreEqual(expected, actual);
                }
                else if((version = value as Version) != null)
                {
                    var actual = result.AttributeSafe(property.Name);
                    var expected = version.ToString(2);
                    Assert.AreEqual(expected, actual);
                }
            }
        }