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); }
public void FindElementOfEqualityOfLeftAndRightSidesTest(double[] array, int?expectedResult) { // Run the method under test var actualResult = ThirdTask.FindElementOfEqualityOfLeftAndRightSides(array); // Verify the result: Assert.AreEqual(expectedResult, actualResult); }
public IActionResult ThirdTask(string UserInput) { //Создаем модель представленияя и передаем ее через Post запрос в представление using (ThirdTask Task = new ThirdTask(UserInput)) { if (!String.IsNullOrEmpty(UserInput)) { return(View("ThirdTaskResult", Task)); } else { return(BadRequest("Не введена строка")); } } }
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)); }
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) { } }
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; } } }
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); }
static void Main() { FirstTask.Run(); SecondTask.Run(); ThirdTask.Run(); }
public void Run1() { var run = ThirdTask.Run(2, ParseExample("1 2 2 1")); Assert.AreEqual("3 4", run); }
public void RunsThridExample() { var run = ThirdTask.Run(2, ParseExample("2 1")); Assert.AreEqual("1 2", run); }
public void RunsSecondExample() { var run = ThirdTask.Run(2, ParseExample("1 2")); Assert.AreEqual("-1 -1", run); }
public void RunsFirstExample() { var run = ThirdTask.Run(4, ParseExample("2 1 4 6")); Assert.AreEqual("-1 -1", run); }