using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;

namespace Sasa.QualityTools.DrFx.Tests.Violation.CSharp.Microsoft.Usage
{
    public static class Rule2234
    {
        // このメソッドは CA2234 に違反しています。
        public static string Download()
        {
            return Rule2234A.Download("http://www.google.com/webhp");
        }
    }

    public static class Rule2234A
    {
        [SuppressMessage("Microsoft.Design", "CA1057:StringUriOverloadsCallSystemUriOverloads")]
        public static string Download(string uri)
        {
            WebClient client = new WebClient();
            return client.DownloadString(uri);
        }

        public static string Download(Uri uri)
        {
            WebClient client = new WebClient();
            return client.DownloadString(uri);
        }
    }
}
