using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;

namespace Sasa.QualityTools.DrFx.Tests.Violation.CSharp.Microsoft.Design
{
    // このクラスは CA1064 に違反しています。
    [Serializable]
    internal class Rule1064 : Exception
    {
        public Rule1064() : base() { }

        public Rule1064(string message) : base(message) { }

        public Rule1064(string message, Exception innerException) : base(message, innerException) { }

        protected Rule1064(SerializationInfo info, StreamingContext context) : base(info, context) { }
    }

    public static class Rule1064A
    {
        public static void ThrowException(int value)
        {
            if (value > 0)
            {
                throw new Rule1064();
            }
            else if (value < 0)
            {
                throw new Rule1064("");
            }
            else
            {
                throw new Rule1064("", new InvalidOperationException());
            }
        }
    }
}
