Ejemplo n.º 1
0
        public static void TestOnkoPvm()
        {
            string test;

            test = "08.11.1993";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "10.11.1993";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "10.11.93";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "8.11.93";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "40.12.1993";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "08/11/1993";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "10-11-1993";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "1993-10-10";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
            test = "1993,10,10";
            Console.WriteLine(test + " = " + Tehtava1.OnkoPvm(test));
        }
Ejemplo n.º 2
0
        public static void TestOnkoLuku()
        {
            string test;

            Console.WriteLine("Näiden tulisi antaa False:");
            test = "sana";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
            test = "";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
            test = "123.3";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
            test = "17a";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
            Console.WriteLine("Näiden tulisi antaa True");
            test = "15";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
            test = "0,15";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
            test = "-1500";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
            test = "+1800,15";
            Console.WriteLine(Tehtava1.OnkoLuku(test));
        }