Exemple #1
0
        public void OutOfRangeTest()
        {
            bool catchException = false;

            try
            {
                TypeOfEqulibrium.Solution(new int[] { 1 });
            }
            catch (ArgumentOutOfRangeException exception)
            {
                catchException = true;
            }
            if (catchException)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
Exemple #2
0
        public void NameOfTest()
        {
            bool catchException = false;

            try
            {
                TypeOfEqulibrium.Solution(null);
            }
            catch (ArgumentNullException)
            {
                catchException = true;
            }

            if (catchException)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
Exemple #3
0
 public void EmptyArrayTest()
 {
     Assert.AreEqual(0, TypeOfEqulibrium.Solution(new int[4]));
 }
Exemple #4
0
 public void TwoElementTest()
 {
     Assert.AreEqual(2, TypeOfEqulibrium.Solution(new int[] { 3, 5 }));
 }
Exemple #5
0
 public void ExampleTest()
 {
     Assert.AreEqual(1, TypeOfEqulibrium.Solution(new int[] { 3, 1, 2, 4, 3 }));
 }