Пример #1
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("\n=====   Opgave 1 : Faculteit   =====\n");
            Opgave1.Run();

            System.Console.WriteLine("\n=====   Opgave 2 : Fibonacci   =====\n");
            Opgave2.Run();

            System.Console.WriteLine("\n=====   Opgave 3 : OmEnOm   =====\n");
            Opgave3.Run();

            System.Console.WriteLine("\n=====   Opgave 4 : Enen   =====\n");
            Opgave4.Run();

            System.Console.WriteLine("\n=====   Opgave 6 : ForwardString   =====\n");
            Opgave6.Run();

            System.Console.WriteLine("\n=====   Opgave 7 : Sorting   =====\n");
            Sorter isort = new InsertionSort();
            Sorter msort = new MergeSort();
            Sorter ssort = new ShellSort();

            isort.Run();
            msort.Run();
            ssort.Run();
            int[] numbers = { 100, 1000, 10000 };
            foreach (int num in numbers)
            {
                isort.RunWithTimer(num);
                msort.RunWithTimer(num);
                ssort.RunWithTimer(num);
            }
        }
Пример #2
0
        public void OmEnOm_ThrowingExceptionOnNegativeInput(int n)
        {
            // Arrange

            // Act & Assert
            Assert.Throws(typeof(OmEnOmNegativeValueException), () => Opgave3.OmEnOm(n));
        }
Пример #3
0
        public void OmEnOm(int n, long expected)
        {
            int actual;

            // Arrange

            // Act
            actual = Opgave3.OmEnOm(n);

            // Assert
            Assert.AreEqual(expected, actual);
        }
        public static void Main()
        {
            Opgave1 Tom = () => Console.WriteLine("Work time");

            Tom();

            Opgave2 vibe = () => 14.2f;

            Console.WriteLine(vibe());

            Opgave3 three = (a, b, c) => Console.WriteLine("oh yeah big brain time");

            three(14, "ooh", 12);

            Console.ReadKey();
        }