예제 #1
0
        static void Main(string[] args)
        {
            var rep = true;

            do
            {
                Console.WriteLine("Choose task:\n1)Arrays merging\n2)Searching for duplicate\n3)Palindrome count");
                var choose = int.Parse(Console.ReadLine());
                Console.WriteLine();

                if (choose == 1)
                {
                    var task = new FirstTask();
                    task.Do();
                }
                if (choose == 2)
                {
                    var task = new SecondTask();
                    task.Do();
                }
                if (choose == 3)
                {
                    var task = new ThirdTask();
                    task.Do();
                }

                Console.WriteLine("\nMore tasks?(y/n)");
                char r = char.Parse(Console.ReadLine());
                if (r == 'n')
                {
                    rep = false;
                }
            } while (rep);
        }
예제 #2
0
        public void FindElementOfEqualityOfLeftAndRightSidesTest(double[] array, int?expectedResult)
        {
            // Run the method under test
            var actualResult = ThirdTask.FindElementOfEqualityOfLeftAndRightSides(array);

            // Verify the result:
            Assert.AreEqual(expectedResult, actualResult);
        }
예제 #3
0
 public IActionResult ThirdTask(string UserInput)
 {
     //Создаем модель представленияя и передаем ее через Post запрос в представление
     using (ThirdTask Task = new ThirdTask(UserInput))
     {
         if (!String.IsNullOrEmpty(UserInput))
         {
             return(View("ThirdTaskResult", Task));
         }
         else
         {
             return(BadRequest("Не введена строка"));
         }
     }
 }
예제 #4
0
        protected override void OnStart(string[] args)
        {
            this.RequestAdditionalTime(30000);

            InitializeService();

            CancellationToken token = _cancellationTokenSource.Token;

            Task.Run(() => FirstTask.Do(token, 5));
            Task.Run(() => SecondTask.Do(token, 5));
            Task.Run(() => ThirdTask.Do(token, 10));
            Task.Run(() => BoothAvailabilityTask.Do(token, 10));
            Task.Run(() => PrintTask.Do(token, 10));
            Task.Run(() => ArchiveUploaderTask.Do(token, 10));
            Task.Run(() => InstagramSearchTask.Do(token, 60));
        }
예제 #5
0
        protected override void OnStart(string[] args)
        {
            InitializeService();

            CancellationToken token = _cancellationTokenSource.Token;

            Task.Run(() => FirstTask.Do(token, 5));
            Task.Run(() => SecondTask.Do(token, 5));
            Task.Run(() => ThirdTask.Do(token, 10));
            Task.Run(() => BoothAvailabilityTask.Do(token, 10));
            Task.Run(() => PrintTask.Do(token, 10));
            Task.Run(() => ArchiveUploaderTask.Do(token, 10));

            while (!token.IsCancellationRequested)
            {
            }
        }
예제 #6
0
        private static void Main()
        {
            Console.WriteLine("Практичнi завдання");

            while (!IsTestingFinished)
            {
                Console.WriteLine("Виберiть подальшi дiї \n" +
                                  "1 - Перевiрити перше завдання\n" +
                                  "2 - Перевiрити друге завдання\n" +
                                  "3 - Перевiрити третє завдання\n" +
                                  "0 - Завершити перевiрку\n" +
                                  "clear - Очистити консоль\n");

                string index = Console.ReadLine();

                switch (index)
                {
                case "1":
                    Console.Clear();
                    FirstTask.Check();
                    break;

                case "2":
                    Console.Clear();
                    SecondTask.Check();
                    break;

                case "3":
                    Console.Clear();
                    ThirdTask.Check();
                    break;

                case "0":
                    IsTestingFinished = true;
                    break;

                case "clear":
                    Console.Clear();
                    break;

                default:
                    Console.WriteLine("Немає такого варiанту!");
                    break;
                }
            }
        }
예제 #7
0
        public void OrderBy123_12returned()
        {
            var list = new List <int>()
            {
                1,
                2,
                3
            };
            var expected = new List <int>()
            {
                1,
                2
            };
            ThirdTask c      = new ThirdTask();
            var       actual = c.Procedure(list);

            CollectionAssert.AreEqual(expected, actual);
        }
예제 #8
0
파일: Program.cs 프로젝트: 127-0-0-l/epam
 static void Main()
 {
     FirstTask.Run();
     SecondTask.Run();
     ThirdTask.Run();
 }
예제 #9
0
        public void Run1()
        {
            var run = ThirdTask.Run(2, ParseExample("1 2 2 1"));

            Assert.AreEqual("3 4", run);
        }
예제 #10
0
        public void RunsThridExample()
        {
            var run = ThirdTask.Run(2, ParseExample("2 1"));

            Assert.AreEqual("1 2", run);
        }
예제 #11
0
        public void RunsSecondExample()
        {
            var run = ThirdTask.Run(2, ParseExample("1 2"));

            Assert.AreEqual("-1 -1", run);
        }
예제 #12
0
        public void RunsFirstExample()
        {
            var run = ThirdTask.Run(4, ParseExample("2 1 4 6"));

            Assert.AreEqual("-1 -1", run);
        }