//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.Test { using System.Collections.Specialized; using DotNetOpenAuth.Logging; using Validation; /// /// An assortment of methods useful for testing. /// internal static class TestUtilities { /// /// The logger that tests should use. /// internal static readonly ILog TestLogger = LogProvider.GetLogger("DotNetOpenAuth.Test"); internal static void ApplyTo(this NameValueCollection source, NameValueCollection target) { Requires.NotNull(source, "source"); Requires.NotNull(target, "target"); foreach (string header in source) { target[header] = source[header]; } } internal static T Clone(this T source) where T : NameValueCollection, new() { Requires.NotNull(source, "source"); var result = new T(); ApplyTo(source, result); return result; } } }