Example #1
0
        public void FindNthRoot_01()
        {
            double expected = 0.1;
            double actual   = Task5.FindNthRoot(0.001, 3, 0.0001);

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void FindNthRoot_03()
        {
            double expected = 0.3;
            double actual   = Task5.FindNthRoot(0.0081, 4, 0.1);

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void FindNthRoot_0545()
        {
            double expected = 0.545;
            double actual   = Task5.FindNthRoot(0.004241979, 9, 0.00000001);

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void CountElementsBiggerThanNeibTest(int MockNumber, int expected)
        {
            int[,] array = DoubleArrayMockTask5.GetMock(MockNumber);
            int actual = Task5.CountElementsBiggerThanNeib(array);

            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void FindNthRoot_m02()
        {
            double expected = -0.2;
            double actual   = Task5.FindNthRoot(-0.008, 3, 0.1);

            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void FindNthRoot_06()
        {
            double expected = 0.6;
            double actual   = Task5.FindNthRoot(0.0279936, 7, 0.0001);

            Assert.AreEqual(expected, actual);
        }
Example #7
0
        public void FindNthRoot_2()
        {
            double expected = 2;
            double actual   = Task5.FindNthRoot(8, 3, 0.0001);

            Assert.AreEqual(expected, actual);
        }
        public void TestMethod1()
        {
            double result    = Task5.FindNthRoot(1, 5, 0.0001);
            double expResult = 1;

            Assert.AreEqual(expResult, result);

            result    = Task5.FindNthRoot(8, 3, 0.0001);
            expResult = 2;
            Assert.AreEqual(expResult, result);

            result    = Task5.FindNthRoot(0.001, 3, 0.0001);
            expResult = 0.1;
            Assert.AreEqual(expResult, result);

            result    = Task5.FindNthRoot(0.04100625, 4, 0.0001);
            expResult = 0.45;
            Assert.AreEqual(expResult, result);

            result    = Task5.FindNthRoot(0.0279936, 7, 0.0001);
            expResult = 0.6;
            Assert.AreEqual(expResult, result);

            result    = Task5.FindNthRoot(0.0081, 4, 0.1);
            expResult = 0.3;
            Assert.AreEqual(expResult, result);

            result    = Task5.FindNthRoot(-0.008, 3, 0.1);
            expResult = -0.2;
            Assert.AreEqual(expResult, result);

            result    = Task5.FindNthRoot(0.004241979, 9, 0.00000001);
            expResult = 0.545;
            Assert.AreEqual(expResult, result);
        }
 public static void Main(string[] args)
 {
     Task3.ExecuteTask();
     Task4.ExecuteTask();
     Task5.ExecuteTask();
     Task6.ExecuteTask();
 }
Example #10
0
        static void Main(string[] args)
        {
Menu:
            int Menu_args;

            Console.WriteLine("Меню: \n");
            Console.WriteLine("1. Информация о дисках:");
            Console.WriteLine("2. Создание .txt файла:");
            Console.WriteLine("3. XML Файлы:");
            Console.WriteLine("4. JSON Файлы:");
            Console.WriteLine("5. ZIP - файлы:");
            Console.WriteLine("0. Выйти");
            Menu_args = Convert.ToInt32(Console.ReadLine());
            switch (Menu_args)
            {
            case 1: Task1.Main(); goto Menu;

            case 2: Task2.Main(); goto Menu;

            case 3: Task3.Main(); goto Menu;

            case 4: Task4.Main(); goto Menu;

            case 5: Task5.Main(); goto Menu;

            case 0: break;

            default: goto Menu;
            }
        }
Example #11
0
 // Update is called once per frame
 void Update()
 {
     TaskCompleted = Click_Interact.RemoveTask;
     if (TaskCompleted == 1)
     {
         Task1.SetActive(false);
     }
     if (TaskCompleted == 2)
     {
         Task2.SetActive(false);
     }
     if (TaskCompleted == 3)
     {
         Task3.SetActive(false);
     }
     if (TaskCompleted == 4)
     {
         Task4.SetActive(false);
     }
     if (TaskCompleted == 5)
     {
         Task1.SetActive(false);
         Task2.SetActive(false);
         Task3.SetActive(false);
         Task4.SetActive(false);
         Task5.SetActive(true);
     }
 }
Example #12
0
        public void FindNthRoot_1()
        {
            double expected = 1;
            double actual   = Task5.FindNthRoot(1, 5, 0.0001);

            Assert.AreEqual(expected, actual);
        }
Example #13
0
        public void FindNthRoot_045()
        {
            double expected = 0.45;
            double actual   = Task5.FindNthRoot(0.04100625, 4, 0.0001);

            Assert.AreEqual(expected, actual);
        }
Example #14
0
        public void TestSmallestMultipleUpTo20()
        {
            var task       = new Task5();
            int upToNumber = 20;

            Assert.AreEqual(232792560, task.Run(upToNumber), $"The smallest positive number that is evenly divisible by all of the numbers from 1" +
                            $" to {upToNumber} digits is incorrect");
        }
Example #15
0
 // Start is called before the first frame update
 void Start()
 {
     Task1.SetActive(true);
     Task2.SetActive(true);
     Task3.SetActive(true);
     Task4.SetActive(true);
     Task5.SetActive(false);
 }
Example #16
0
        public void Test7()
        {
            var result = Task5.GetEvenOrOdd(0);

            if (result != "zero")
            {
                Assert.Fail();
            }
        }
Example #17
0
        public void Test6()
        {
            var result = Task5.GetEvenOrOdd(120);

            if (result != "par")
            {
                Assert.Fail();
            }
        }
Example #18
0
        public void Test1()
        {
            var result = Task5.GetEvenOrOdd(1);

            if (result != "impar")
            {
                Assert.Fail();
            }
        }
Example #19
0
        public void QuickSortTest()
        {
            string stringToSort = "adfirebjzl5463121";
            string expected     = "1123456abdefijlrz";

            string sorted = Task5.QuickSort(stringToSort);

            Assert.That(sorted, Is.EqualTo(expected));
        }
        static void Main(string[] args)
        {
            Func <Task5, Task5.Virus> TaskSolver = task =>
            {
                Task5.Virus virus = new SuperVirus();
                return(virus);
            };

            Task5.CheckSolver(TaskSolver);
        }
Example #21
0
        public void FindNthRoot_InputCorrectValues(double value, int root, double eps)
        {
            //Arrange
            //Test case

            ///Act
            double result = Task5.FindNthRoot(value, root, eps);

            //Arrange
            Assert.IsTrue(Math.Abs(result - Math.Pow(value, 1.0 / root)) < eps);
        }
Example #22
0
        public void FindNthRootTestCase6()
        {
            //arrange
            double testNumber = 0.0081;
            int    testDegree = 4;
            double precision  = 0.1;
            double expected   = 0.3;
            //act
            double actual = Task5.FindNthRoot(testNumber, testDegree, precision);

            //assert
            Assert.AreEqual(expected, actual, 1);
        }
Example #23
0
        public void FindNthRootTestCase8()
        {
            //arrange
            double testNumber = 0.004241979;
            int    testDegree = 9;
            double precision  = 0.00000001;
            double expected   = 0.545;
            //act
            double actual = Task5.FindNthRoot(testNumber, testDegree, precision);

            //assert
            Assert.AreEqual(expected, actual, 1);
        }
Example #24
0
 /// <summary>
 /// The main.
 /// </summary>
 /// <param name="args">
 /// The args.
 /// </param>
 private static void Main(string[] args)
 {
     Task1.Execute();
     Task2.Execute();
     Task3.Execute();
     Task4.Execute();
     Task5.Execute();
     Task6.Execute();
     Task7.Execute();
     Task8.Execute();
     Task9.Execute();
     Task10.Execute();
 }
Example #25
0
 /// <summary>
 /// The main.
 /// </summary>
 /// <param name="args">
 /// The args.
 /// </param>
 private static void Main(string[] args)
 {
     Task2.ExtractArtists(FileName);
     Task3.ExtractArtistsXPath(FileName);
     Task4.DeleteAllAlbumsWithPriceMoreThan20(FileName);
     Task5.ExtractAllSongTitles(FileName);
     Task6.ExtractAllSongTitlesXpathLinq(FileName);
     Task7.CreateXmlFromTxtFile(TxtName);
     Task8.CreateAlbumXml(FileName);
     Task9.TraverseDirectory("../..");
     Task10.TraverseDirectory("../..");
     Task11.ExtractAlbumPrices(FileName);
     Task12.ExtractAlbumPricesLinq(FileName);
     Task14.ConvertXmlToXsl(FileName, XslName);
     Task16.GenerateXsdFile(FileName);
 }
Example #26
0
        static void Main(string[] args)
        {
            while (true)
            {
                IOservice.ShowMessage
                (
                    "1 - TaskOne (conversion from grams)\n" +
                    "2 - TaskTwo (converting bytes to kilo, mega, Giga)\n" +
                    "3 - TaskThree (Centimeters to meters and kilometers)\n" +
                    "4 - TaskFour (Swap values of variables without using an additional variable)\n" +
                    "5 - TaskFive (the ratio of the cost of 1 kg of candy to 1 kg of gelatine)\n" +
                    "exit - Exit the program"
                );
                string command = IOservice.GetUserInputStr();
                switch (command)
                {
                case "1":
                    Task1.StartTask();
                    break;

                case "2":
                    Task2.StartTask();
                    break;

                case "3":
                    Task3.StartTask();
                    break;

                case "4":
                    Task4.StartTask();
                    break;

                case "5":
                    Task5.StartTask();
                    break;

                case "exit":
                    return;

                default:
                    IOservice.ShowMessage("Unknown command");
                    break;
                }
            }
        }
Example #27
0
        static void Main(string[] args)
        {
            AbstractTask App;

            App = new Task1();
            App.Start();

            App = new Task2();
            App.Start();

            App = new Task3();
            App.Start();

            App = new Task4();
            App.Start();

            App = new Task5();
            App.Start();
        }
    // Start is called before the first frame update
    void Awake()
    {
        SelectorNode root = new SelectorNode();

        SequenceNode seq1  = new SequenceNode();
        Task1        task1 = new Task1(sc, pl);
        Task2        task2 = new Task2(sc, pl);

        seq1.addChild(task1);
        seq1.addChild(task2);

        SequenceNode seq2  = new SequenceNode();
        Task3        task3 = new Task3(sc, osc);
        Task4        task4 = new Task4(sc, osc);

        seq2.addChild(task3);
        seq2.addChild(task4);

        SelectorNode sel2  = new SelectorNode();
        SequenceNode seq3  = new SequenceNode();
        Task5        task5 = new Task5(sc);
        Task6        task6 = new Task6(sc);

        seq3.addChild(task5);
        seq3.addChild(task6);
        Task7 task7 = new Task7(sc);

        sel2.addChild(seq3);
        sel2.addChild(task7);

        root.addChild(seq1);
        root.addChild(seq2);
        root.addChild(sel2);

        behavior = new BehaviorTree(root);

        sc.SetDestination(sc.transform.position);
    }
Example #29
0
 public void DivideByZeroExceptionTest(int x1, int y1, int x2, int y2)
 {
     Assert.Throws <DivideByZeroException>(() => Task5.WriteLinearEquationByLetters(x1, y1, x2, y2));
 }
Example #30
0
        public void WriteLinearEquationByLettersTest(int x1, int y1, int x2, int y2, string expected)
        {
            string actual = Task5.WriteLinearEquationByLetters(x1, y1, x2, y2);

            Assert.AreEqual(expected, actual);
        }