Ejemplo n.º 1
0
        public void FailWithIndexing2()
        {
            SystemOLE listofcoef = new SystemOLE(4);

            listofcoef[0] = new LinearEquation("1, 2, 3, 4");
            listofcoef[1] = new LinearEquation("3, 5, 7, 9");
            listofcoef[2] = new LinearEquation("5, 8, 4, 2");
            listofcoef[3] = new LinearEquation("2, 14, 8, 11");
            Assert.Equals(typeof(ArgumentOutOfRangeException), listofcoef[7]);
        }
Ejemplo n.º 2
0
        public void NoMoreSolutionsChecking()
        {
            SystemOLE listofcoef = new SystemOLE(4);

            listofcoef.Add(new LinearEquation("1, 2, 3, 4"));
            listofcoef.Add(new LinearEquation("15, 35, 14, 9"));
            listofcoef.Add(new LinearEquation("12, 45, 89, 0"));
            listofcoef.Add(new LinearEquation("1, 2, 3, 6"));
            listofcoef.StepConvert();
            Assert.Equals(typeof(ArgumentException), listofcoef.GaussMethod());
        }
Ejemplo n.º 3
0
        public void InfinitySolutionsChecking()
        {
            SystemOLE listofcoef = new SystemOLE(4);

            listofcoef.Add(new LinearEquation("1, 2, 3, 4"));
            listofcoef.Add(new LinearEquation("3, 5, 7, 9"));
            listofcoef.Add(new LinearEquation("5, 8, 4, 2"));
            listofcoef.Add(new LinearEquation("2, 14, 8, 11"));
            listofcoef.StepConvert();
            Assert.Equals(typeof(ArgumentException), listofcoef.GaussMethod());
        }