Beispiel #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine ("ZadaniaBartosza from wykop.pl http://www.wykop.pl/tag/zadaniabartosza/");

            //task 1 example (more in unit tests)
            Task1 task1 = new Task1();
            var result1 = task1.Factorial (10);

            Task2 task2 = new Task2 ();
            var result2 = task2.IsPrimeNumber(3);

            Task3 task3 = new Task3 ();
            task3.GetSmallestCommonDivisor (2, 4);

            Task4 task4 = new Task4 ();
            var a = Math.Pow (3, 5);
            var b = task4.Power (3, 5);
            var c = task4.Power (3, -3);

            var randomSortList = Task5.GetRandomSortList ();
            foreach (var random in randomSortList) {
                Console.WriteLine (random);
            }

            Task6 task61 = new Task6 ();
            Task6 task62 = new Task6 ();
            Task6 task63 = new Task6 ();

            bool areEqual = false;
            if (task61.PositionX == task62.PositionX && task62.PositionX == task63.PositionX &&
                task61.PositionY == task62.PositionY && task62.PositionY == task63.PositionY) {
                areEqual = true;
            }
            Console.ReadKey ();
        }
Beispiel #2
0
        public void PowerTests()
        {
            Task4 task = new Task4();

            Assert.AreEqual(Math.Pow(2, 4), task.Power(2, 4));
            Assert.AreEqual(Math.Pow(3, 9), task.Power(3, 9));
            Assert.AreEqual(Math.Pow(2, 8), task.Power(2, 8));
            Assert.AreEqual(Math.Pow(3, 8), task.Power(3, 8));
            Assert.AreEqual(Math.Pow(1, 1), task.Power(1, 1));
            Assert.AreEqual(Math.Pow(0, 1), task.Power(0, 1));
            Assert.AreEqual(Math.Pow(1, 0), task.Power(1, 0));
            Assert.AreEqual(Math.Pow(-3, 3), task.Power(-3, 3));
            Assert.AreEqual(Math.Pow(-1, 2), task.Power(-1, 2));
            Assert.AreEqual(Math.Pow(2, -2), task.Power(2, -2));
            Assert.AreEqual(Math.Pow(3, -4), task.Power(3, -4));
            Assert.AreEqual(Math.Pow(-3, -4), task.Power(-3, -4));
        }
Beispiel #3
0
        public void PowerTests()
        {
            Task4 task = new Task4();

            Assert.AreEqual(Math.Pow (2, 4),  task.Power(2,4));
            Assert.AreEqual(Math.Pow (3, 9),  task.Power(3,9));
            Assert.AreEqual(Math.Pow (2, 8),  task.Power(2,8));
            Assert.AreEqual(Math.Pow (3, 8),  task.Power(3,8));
            Assert.AreEqual(Math.Pow (1, 1),  task.Power(1,1));
            Assert.AreEqual(Math.Pow (0, 1),  task.Power(0,1));
            Assert.AreEqual(Math.Pow (1, 0),  task.Power(1,0));
            Assert.AreEqual(Math.Pow (-3, 3),  task.Power(-3,3));
            Assert.AreEqual(Math.Pow (-1, 2),  task.Power(-1,2));
            Assert.AreEqual(Math.Pow (2, -2),  task.Power(2,-2));
            Assert.AreEqual(Math.Pow (3, -4),  task.Power(3,-4));
            Assert.AreEqual(Math.Pow (-3, -4),  task.Power(-3,-4));
        }
Beispiel #4
0
        public static void Main(string[] args)
        {
            Console.WriteLine("ZadaniaBartosza from wykop.pl http://www.wykop.pl/tag/zadaniabartosza/");

            //task 1 example (more in unit tests)
            Task1 task1   = new Task1();
            var   result1 = task1.Factorial(10);

            Task2 task2   = new Task2();
            var   result2 = task2.IsPrimeNumber(3);

            Task3 task3 = new Task3();

            task3.GetSmallestCommonDivisor(2, 4);

            Task4 task4 = new Task4();
            var   a     = Math.Pow(3, 5);
            var   b     = task4.Power(3, 5);
            var   c     = task4.Power(3, -3);

            var randomSortList = Task5.GetRandomSortList();

            foreach (var random in randomSortList)
            {
                Console.WriteLine(random);
            }

            Task6 task61 = new Task6();
            Task6 task62 = new Task6();
            Task6 task63 = new Task6();

            bool areEqual = false;

            if (task61.PositionX == task62.PositionX && task62.PositionX == task63.PositionX &&
                task61.PositionY == task62.PositionY && task62.PositionY == task63.PositionY)
            {
                areEqual = true;
            }
            Console.ReadKey();
        }