Ejemplo n.º 1
0
        public void ComparingMethodTime()
        {
            OneMethod.SimpleCall();
            long expected = sleepTime;
            long actual   = tracer.GetTraceResult().ThreadResults[0].MethodList[0].Time;

            Assert.AreEqual(true, actual >= expected);
        }
Ejemplo n.º 2
0
        public void ComparingMethodClassName()
        {
            OneMethod.SimpleCall();
            string expected = "OneMethod";
            string actual   = tracer.GetTraceResult().ThreadResults[0].MethodList[0].ClassMethodName;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
            public static void MainMethod()
            {
                OneMethod.SimpleCall();

                var thread = new Thread(() => ThreadMethod());

                thread.Start();
                thread.Join();
            }
Ejemplo n.º 4
0
    public static void xMain()
    {
        string myChoice;

        OneMethod om = new OneMethod();

        do
        {
            myChoice = om.getChoice();

            // Make a decision based on the user's choice
            switch (myChoice)
            {
            case "A":
            case "a":
                Console.WriteLine("You wish to add an address.");
                break;

            case "D":
            case "d":
                Console.WriteLine("You wish to delete an address.");
                break;

            case "M":
            case "m":
                Console.WriteLine("You wish to modify an address.");
                break;

            case "V":
            case "v":
                Console.WriteLine("You wish to view the address list.");
                break;

            case "Q":
            case "q":
                Console.WriteLine("Bye.");
                break;

            default:
                Console.WriteLine("{0} is not a valid choice", myChoice);
                break;
            }

            // Pause to allow the user to see the results
            Console.WriteLine();
            Console.Write("press Enter key to continue...");

            Console.ReadLine();
            Console.WriteLine();
        } while (myChoice != "Q" && myChoice != "q"); // Keep going until the user wants to quit

        // keep screen from going away
        // when run from VS.NET
        Console.ReadLine();
    }
Ejemplo n.º 5
0
    public static void Main()
    {
        string myChoice;

        OneMethod om = new OneMethod(); //об'ява методу екземпляру класу

        // om –адреса посилання на метод

        do
        {
            myChoice = om.getChoice();  // звернення до методу екземпляру

            // Make a decision based on the user's choice
            switch (myChoice)
            {
            case "A":
            case "a":
                Console.WriteLine("You wish to add an address.");
                break;

            case "D":
            case "d":
                Console.WriteLine("You wish to delete an address.");
                break;

            case "M":
            case "m":
                Console.WriteLine("You wish to modify an address.");
                break;

            case "V":
            case "v":
                Console.WriteLine("You wish to view the address list.");
                break;

            case "Q":
            case "q":
                Console.WriteLine("Bye.");
                break;

            default:
                Console.WriteLine("{0} is not a valid choice", myChoice);
                break;
            }

            // Pause to allow the user to see the results
            Console.WriteLine();
            Console.Write("press Enter key to continue...");

            Console.ReadLine();
            Console.WriteLine();
        } while (myChoice != "Q" && myChoice != "q"); // repeat until
    }
Ejemplo n.º 6
0
    public static void Main()
    {
        string myChoice;

        OneMethod om = new OneMethod();

        do
           {
            myChoice = om.getChoice();

            // Make a decision based on the user's choice
            switch(myChoice)
            {
                case "A":
                case "a":
                    Console.WriteLine("You wish to add an address.");
                    break;
                case "D":
                case "d":
                    Console.WriteLine("You wish to delete an address.");
                    break;
                case "M":
                case "m":
                    Console.WriteLine("You wish to modify an address.");
                    break;
                case "V":
                case "v":
                    Console.WriteLine("You wish to view the address list.");
                    break;
                case "Q":
                case "q":
                    Console.WriteLine("Bye.");
                    break;
                default:
                    Console.WriteLine("{0} is not a valid choice", myChoice);
                    break;
            }

            // Pause to allow the user to see the results
            Console.WriteLine();
            Console.Write("Press Enter key to continue...");

            Console.ReadLine();
            Console.WriteLine();

        } while (myChoice != "Q" && myChoice != "q"); // Keep going until the user wants to quit
    }