public void TwoNumberSumUsingSorting()
 {
     int[] expected = { -47, 210 };
     int[] actual   = TwoNumberSum.UsingSorting(arrayOne, 163);
     Array.Sort(actual);
     Assert.AreEqual(actual, expected);
 }
        public void TestCase1()
        {
            int[] expected = { 4, 6 };
            int   testSum  = 10;

            int[] results = TwoNumberSum.BurteForce(expected, testSum);

            Assert.That(expected, Is.EqualTo(results));
        }
        public void TestCase2()
        {
            int[] expected  = { -1, 11 };
            int[] testArray = { 3, 5, -4, 8, 11, 1, -1, 6 };
            int   testSum   = 10;

            int[] results = TwoNumberSum.TwoNumberSum2(testArray, testSum);
            //    Array.Sort(results);
            Assert.That(expected, Is.EqualTo(results));
        }
        public void BurteForceWorks()
        {
            int[] testArray     = { 3, 5, -4, 8, 11, 1, -1, 6 };
            int   testTargetSum = 10;

            int[] results = TwoNumberSum.BurteForce(testArray, testTargetSum);

            int[] expected = { -1, 11 };
            Assert.That(expected, Is.EqualTo(results));
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            // Hostess greets with something like hello
            var hostess = new Hostess("C# Bitches");

            hostess.OpenGreeting();

            var x = new TwoNumberSum();

            x.readFile();

            // It shows a list of filenames in the algoexpert folder in a list number format

            // It asks you to choose a number(algo) to display

            // It prints the algorithm to the console or err

            // It asks if you want to reset
        }
        public void TwoNumberSumWorker2_WhenCalled_ReturnEmptyArray(int[] input, int[] answer, int targetSum)
        {
            var arr = TwoNumberSum.TwoNumberSumWorker2(input, targetSum);

            Assert.That(arr, Is.EquivalentTo(answer));
        }