예제 #1
0
        public UnitTest1()
        {
            Func <double[], double> areaSquare = (sides) =>
            {
                return(sides[0] * sides[1]);
            };
            Func <double[], bool> identitySquare = (sides) =>
            {
                if (sides.Length != 2)
                {
                    return(false);
                }
                if (sides[0] == sides[1])
                {
                    return(true);
                }
                return(false);
            };

            AreaCalculation.AddFigure("Square", areaSquare, identitySquare);
        }
예제 #2
0
 public void AddFigureInvalidAreaFunc()
 {
     AreaCalculation.AddFigure("Тест", null, null);
 }
예제 #3
0
 public void AddFigureInvalidIdentify()
 {
     AreaCalculation.AddFigure("Тест2", (x) => { return(x[0]); }, null);
 }
예제 #4
0
 public void AddFigureInvalidName()
 {
     AreaCalculation.AddFigure(null, null, null);
 }