namespace Singularity.TestClasses.TestClasses
{
    public interface ICalculator1
    {
        int Add(int first, int second);
    }

    public interface ICalculator2
    {
        int Add(int first, int second);
    }

    public interface ICalculator3
    {
        int Add(int first, int second);
    }

    public class Calculator1 : ICalculator1
    {
        private static int counter;

        public Calculator1()
        {
            System.Threading.Interlocked.Increment(ref counter);
        }

        public static int Instances
        {
            get => counter;
            set => counter = value;
        }

        public virtual int Add(int first, int second) => first + second;
    }

    public class Calculator2 : ICalculator2
    {
        private static int counter;

        public Calculator2()
        {
            System.Threading.Interlocked.Increment(ref counter);
        }

        public static int Instances
        {
            get => counter;
            set => counter = value;
        }

        public virtual int Add(int first, int second) => first + second;
    }

    public class Calculator3 : ICalculator3
    {
        private static int counter;

        public Calculator3()
        {
            System.Threading.Interlocked.Increment(ref counter);
        }

        public static int Instances
        {
            get => counter;
            set => counter = value;
        }

        public virtual int Add(int first, int second) => first + second;
    }
}
