Exemplo n.º 1
0
        public void getNLesWhereTIsPosetivAndSmall()
        {
            N_LES target = new N_LES();

            target.init(1, 1, 574.136m, 1, 1, 1, 1963, 5, 1, 1, 1, 1, -165.7m, -38.5m);
            Decimal expectedHigh = (Decimal)5.085914731;
            Decimal expectedLow  = (Decimal)5.085914730;
            Decimal actual       = target.getNLesKgNPrHa();

            //Assert.AreEqual(actual, expectedHigh);
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }

            expectedHigh = (Decimal)2253.060226;
            expectedLow  = (Decimal)2253.060225;
            actual       = target.getNLesMgPrL();


            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 2
0
        public void exelTestNLess()
        {
            N_LES instance = new N_LES();



            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 3, (decimal)7.1, (decimal)6.9, (decimal)45.417, (decimal)45.417, 0, 0);

            instance = new N_LES();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 2, 4m, 4.9m, (decimal)51.7003, (decimal)51.7003, (decimal)(-7.6), 0);
            instance = new N_LES();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 3, 7.1m, 6.9m, (decimal)44.2059, (decimal)44.2059, (decimal)(-7.6), 0);
            instance = new N_LES();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 4, 9.7m, 7.6m, (decimal)42.0424, (decimal)42.0424, (decimal)(-7.6), 0);
            instance = new N_LES();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 5, 12.2m, 12.1m, (decimal)36.2735, (decimal)36.2735, (decimal)(-7.6), 0);
            instance = new N_LES();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 6, 13.3m, 12.3m, (decimal)35.8916, (decimal)35.8916, (decimal)(-7.6), 0);
            instance = new N_LES();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 7, 14.4m, 17.8m, (decimal)39.777, (decimal)39.7777, (decimal)(-7.6), 0);
            instance = new N_LES();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 1, 3.4m, 3.6m, (decimal)38.7943, (decimal)38.7943, (decimal)(-7.6), 0);
        }
Exemplo n.º 3
0
        public void getNLesWhereTIsPosetivAndSmall2()
        {
            N_LES target = new N_LES();

            target.init(0, 0, 0, 0, 0, 0, 2010, 1, 0, 0, 1, 1, (Decimal)(-165.7), (Decimal)(-38.5));

            Decimal expectedHigh = (Decimal)0.000000469221;
            Decimal expectedLow  = (Decimal)0.000000469220;
            Decimal actual       = target.getNLesKgNPrHa();

            if (expectedHigh <= actual || expectedLow >= actual)
            {
                Assert.Fail();
            }

            expectedHigh = (Decimal)0.000207865;
            expectedLow  = (Decimal)0.000207864;
            actual       = target.getNLesMgPrL();


            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 4
0
        public void getNLesBasicInputTree()
        {
            N_LES target = new N_LES();

            target.init(3, 3, 3, 3, 3, 3, 1963, 3, 3, 3, 3, 3, 28.8m, 14.2m);
            Decimal expectedHigh = (Decimal)11.92260595;
            Decimal expectedLow  = (Decimal)11.92260594;
            Decimal actual;

            actual = target.getNLesKgNPrHa();

            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }

            expectedHigh = (Decimal)1760.571479;
            expectedLow  = (Decimal)1760.571478;
            actual       = target.getNLesMgPrL();

            // Assert.AreEqual(actual, expectedHigh);
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 5
0
        public void getNLesWhereTIsNegative()
        {
            N_LES target = new N_LES();
            int   t      = target.init(1, 1, 1, 1, 1, 1, 1963, 5, 1, 1, 1, 1, 0, -38.5m);

            Assert.AreEqual(0, t);
            Decimal expectedHigh = (Decimal)5.052917410;
            Decimal expectedLow  = (Decimal)5.052917409;
            Decimal actual       = target.getNLesKgNPrHa();

            //   Assert.AreEqual(expectedLow, actual);
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }

            expectedHigh = (Decimal)2238.442413;
            expectedLow  = (Decimal)2238.442412;
            actual       = target.getNLesMgPrL();


            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 6
0
        public void randomTestNless()
        {
            System.Random RandNum  = new System.Random();
            N_LES         instance = new N_LES();

            decimal N_Niveau;
            decimal N_Spring;
            decimal N_Fall;
            decimal N_Fix;
            decimal N_GrazingManure;
            decimal N_Removed;
            int     Year;
            int     SoilType;
            decimal Humus;
            decimal Clay;
            decimal Run_Off1;
            decimal Run_Off2;

            decimal[] CrpCoeffValues     = { (decimal)(-165.7), (decimal)(-98.6), -42, (decimal)(-7.6), 0, (decimal)28.8 };;
            decimal[] PreCropCoeffValues = { (decimal)(37.7), (decimal)(14.2), 0, (decimal)(-38.5) };
            decimal   CropCoeff;
            decimal   PreCropCoeff;

            for (int i = 0; i < 10000; i++)
            {
                N_Niveau        = (decimal)RandNum.NextDouble() * (2);
                N_Spring        = (decimal)RandNum.NextDouble() * (300);
                N_Fall          = (decimal)RandNum.NextDouble() * (150);
                N_Fix           = (decimal)RandNum.NextDouble() * (300);
                N_GrazingManure = (decimal)RandNum.NextDouble() * (200);
                N_Removed       = (decimal)RandNum.NextDouble() * (250);
                Year            = RandNum.Next(1963, 2063);
                SoilType        = RandNum.Next(1, 12);
                Humus           = (decimal)(RandNum.NextDouble() * (0.5));
                Clay            = (decimal)(RandNum.NextDouble() * (0.7));
                Run_Off1        = (decimal)(50 + RandNum.NextDouble() * (650));
                Run_Off2        = (decimal)(50 + RandNum.NextDouble() * (650));


                CropCoeff = CrpCoeffValues[RandNum.Next(0, 5)];

                PreCropCoeff = PreCropCoeffValues[RandNum.Next(0, 3)];
                instance     = new N_LES();
                instance.init(N_Niveau, N_Spring, N_Fall, N_Fix, N_GrazingManure, N_Removed, Year, SoilType, Humus, Clay, Run_Off1, Run_Off2, CropCoeff, PreCropCoeff);
            }
        }
Exemplo n.º 7
0
        public void getNLesBasicInputOne()
        {
            N_LES target = new N_LES();

            target.init(1, 1, 1, 1, 1, 1, 1963, 1, 1, 1, 1, 1, 28.8m, 14.2m);
            Decimal expectedHigh = (Decimal)5.242925834;
            Decimal expectedLow  = (Decimal)5.242925833;
            Decimal actual;

            actual = target.getNLesKgNPrHa();
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
            expectedHigh = (Decimal)2322.616145;
            expectedLow  = (Decimal)2322.616144;
            actual       = target.getNLesMgPrL();
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 8
0
        public void getNLesBasicInputZero()
        {
            N_LES target    = new N_LES();
            int   errorcode = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, -165.7m, -38.5m);

            Assert.AreEqual(errorcode, 0);
            Decimal expectedHigh = (Decimal)5.635264457;
            Decimal expectedLow  = (Decimal)5.635264456;
            Decimal actual       = target.getNLesKgNPrHa();

            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
            expectedHigh = (Decimal)2496.422155;
            expectedLow  = (Decimal)2496.422154;
            actual       = target.getNLesMgPrL();
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 9
0
        public void getNLesBasicInputTwo()
        {
            N_LES target = new N_LES();

            target.init(2, 2, 2, 2, 2, 2, 1963, 2, 2, 2, 2, 2, 28.8m, 14.2m);
            Decimal expectedHigh = (Decimal)9.129335463;
            Decimal expectedLow  = (Decimal)9.129335462;
            Decimal actual;

            actual = target.getNLesKgNPrHa();
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }

            expectedHigh = (Decimal)2022.147805;
            expectedLow  = (Decimal)2022.147804;
            actual       = target.getNLesMgPrL();
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 10
0
        public void getNLesBasicInputFive()
        {
            N_LES target = new N_LES();

            target.init(5, 5, 5, 5, 5, 5, 1963, 5, 5, 5, 5, 5, 28.8m, 14.2m);
            Decimal expectedHigh = (Decimal)15.01900124;
            Decimal expectedLow  = (Decimal)15.01900123;
            Decimal actual;

            actual = target.getNLesKgNPrHa();

            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }

            expectedHigh = (Decimal)1330.68351;
            expectedLow  = (Decimal)1330.683509;
            actual       = target.getNLesMgPrL();
            if (expectedHigh < actual || expectedLow > actual)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 11
0
        public void systematicTestNLess()
        {
            N_LES instance = new N_LES();


            decimal N_Niveau = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(N_Niveau, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                N_Niveau += (decimal)0.02;
            }
            instance = new N_LES();
            decimal spring = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)spring, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                spring += (decimal)3;
            }
            instance = new N_LES();
            decimal fall = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)fall, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                fall += (decimal)0.75;
            }
            instance = new N_LES();
            decimal fix = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)fix, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                fix += (decimal)3;
            }
            instance = new N_LES();
            decimal graceing = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)graceing, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                graceing += (decimal)1;
            }
            instance = new N_LES();
            decimal nremove = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, nremove, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                nremove += (decimal)2.5;
            }
            instance = new N_LES();
            int year = 1963;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, year, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                year += 1;
            }
            instance = new N_LES();
            decimal humus = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, humus, (decimal)0.35, 375, 375, 1, 1);
                humus += (decimal)0.005;
            }
            instance = new N_LES();
            decimal clay = (decimal)0;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)clay, 375, 375, 1, 1);
                clay += (decimal)0.007;
            }
            instance = new N_LES();
            decimal RunOff = (decimal)50;

            for (int i = 0; i < 101; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, RunOff, RunOff, 1, 1);
                RunOff += (decimal)6.5;
            }
            instance = new N_LES();
            int SoilType = 1;

            for (int i = 0; i < 12; i++)
            {
                instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, SoilType, (decimal)0.25, (decimal)0.35, 375, 375, 1, 1);
                SoilType += 1;
            }
            instance = new N_LES();
            //Y1
            decimal CropOFF = (decimal)(-165.7);

            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, CropOFF, 1);
            instance = new N_LES();
            //Y2
            CropOFF = (decimal)(-98.6);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, CropOFF, 1);
            instance = new N_LES();
            //Y3
            CropOFF = (decimal)(-42);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, CropOFF, 1);
            instance = new N_LES();
            //Y4
            CropOFF = (decimal)(-7.6);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, CropOFF, 1);
            //Y5
            instance = new N_LES();
            CropOFF  = (decimal)(0);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, CropOFF, 1);
            //Y6
            instance = new N_LES();
            CropOFF  = (decimal)(28.8);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, CropOFF, 1);

            instance = new N_LES();
            decimal PreCropCoeff = (decimal)(34.7);

            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, PreCropCoeff);

            instance     = new N_LES();
            PreCropCoeff = (decimal)(14.2);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, PreCropCoeff);

            instance     = new N_LES();
            PreCropCoeff = (decimal)(0);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, PreCropCoeff);

            instance     = new N_LES();
            PreCropCoeff = (decimal)(0);
            instance.init(1, (decimal)150, (decimal)75, (decimal)150, (decimal)100, 125, 2013, 6, (decimal)0.25, (decimal)0.35, 375, 375, 1, PreCropCoeff);
        }
Exemplo n.º 12
0
        public void N_LESExeption()
        {
            bool  expetion = false;
            N_LES target   = target = new N_LES();

            try{
                target.getNLesKgNPrHa();
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES:Has not been init before receiving output\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                target.getNLesKgNPrHa();
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES:Has not been init before receiving output\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            int returnvalute;

            expetion = false;
            try
            {
                returnvalute = target.init(-9000, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Niveau is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(-1, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Niveau is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(900, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, -999, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Spring is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, -1, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Spring is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(0, 100, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, -999, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Fall is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, -1, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Fall is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(0, 0, 999, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, -1999, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Fix is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, -1, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Fix is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(0, 0, 0, 999, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, -1999, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_GrazingManure is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, -1, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_GrazingManure is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(0, 0, 0, 0, 999, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, -900, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Removed is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, -1, 1963, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: N_Removed is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(0, 0, 0, 0, 0, 9000, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Year is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1962, 1, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Year is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 2050, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, -90, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: SoilType is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 0, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: SoilType is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 6, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 12, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 13, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: SoilType is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 90, 0, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: SoilType is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, -199, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Humus is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);


            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, -1, 0, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Humus is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 9000, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, -199, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Clay is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, -1, 1, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Clay is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 999, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, -9999, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Run_Off is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 0, 1, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Run_Off is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 9000, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);


            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, -9999, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Run_Off is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 0, 0, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: Run_Off is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 999, 0, 0);
            Assert.AreEqual(0, returnvalute);


            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, -165.7m, 0);
            Assert.AreEqual(0, returnvalute);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, -98.6m, 0);
            Assert.AreEqual(0, returnvalute);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, -42m, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, -8, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: CropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);



            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, -7.6m, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, -2, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: CropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 5, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: CropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 28.8m, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 30, 0);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: CropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 900);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 34.8m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 34.7m);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 34.6m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 17);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 14.3m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 14.2m);
            Assert.AreEqual(0, returnvalute);

            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 14.1m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 7);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);

            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0.1m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 0);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, -0.1m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, -10m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, -38.4m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, -38.5m);
            Assert.AreEqual(0, returnvalute);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, -38.6m);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
            expetion = false;
            try
            {
                returnvalute = target.init(0, 0, 0, 0, 0, 0, 1963, 1, 0, 0, 1, 1, 0, 40);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Message: Cannot handle exeption with name \"N_LES: PreCropCoeff is not valid\" and type 2"))
                {
                    expetion = true;
                }
            }
            Assert.IsTrue(expetion);
        }