static void Main(string[] args)
        {
            GSMTest test = new GSMTest();
            string testResult = test.displayInformation();

            Console.WriteLine(testResult);
            //Console.WriteLine(GSM.IPhone4S);
            //Console.WriteLine("**********************");

            //GSM tester = new GSM();
            //Call newCall = new Call("08.08.2012", "18:00", "0886254882", 600);
            //Console.WriteLine(newCall);
            //Call newCaller = new Call("10.02.2012", "17:00", "0886254882", 600);
            //Call newCaller2 = new Call("11.12.2012", "17:00", "0886254882", 600);
            //Call newCaller3 = new Call("08.08.2012", "18:00", "0886254882", 600);
            //tester.AddCall(newCaller);
            //tester.AddCall(newCaller2);
            //tester.AddCall(newCaller3);
            ////tester.RemoveCall(1);
            ////tester.EmptyCallHistory();

            //decimal price = tester.CalculatePrice(1.0m);
            //Console.WriteLine("{0:F2}лв.", price);

            GSMCallHistoryTest testCall = new GSMCallHistoryTest();
            testCall.Test();
        }
Example #2
0
 public static void Main()
 {
     GSMTest test = new GSMTest();
     test.DisplayInfo();
     GSMCallHistoryTest testCalls = new GSMCallHistoryTest();
     testCalls.TestCalls();
 }
        static void Main(string[] args)
        {
            //run GSMTest class
            GSMTest.StartGSMTest();

            //run GSMCallHIstoryTest class
            GSMCallHistoryTest.StartGSMCallHistoryTest();
        }
Example #4
0
        public static void Main()
        {
            GSMTest test = new GSMTest();

            test.DisplayInfo();
            GSMCallHistoryTest testCalls = new GSMCallHistoryTest();

            testCalls.TestCalls();
        }
Example #5
0
        static void Main()
        {
            var gsmTest = new GSMTest();

            gsmTest.DisplayGsmInformation();

            var callTest = new GSMCallHistoryTest();

            callTest.Test();
        }
Example #6
0
        public static void Main()
        {
            //test the GSMClass (ex 1 - 7)
            GSMTest.Test();

            Console.WriteLine("\nGSM CallManager Test:\n");

            //Test the GSMCallHistory (ex 8 -12)
            GSMCallHistoryTest.Test();
        }
Example #7
0
        static void Main()
        {
            // Test here

            //GSMTest gsmTest = new GSMTest();
            //Console.WriteLine(gsmTest.TestMobilePhoneCreation());
            GSMCallHistoryTest callTest = new GSMCallHistoryTest();
            Console.WriteLine(callTest.TestCallsAdding());
            GSMCallFixedPrice callPrice = new GSMCallFixedPrice();
            Console.WriteLine(callPrice.CalculatePrice());
        }
Example #8
0
        static void Main()
        {
            // Test here

            //GSMTest gsmTest = new GSMTest();
            //Console.WriteLine(gsmTest.TestMobilePhoneCreation());
            GSMCallHistoryTest callTest = new GSMCallHistoryTest();

            Console.WriteLine(callTest.TestCallsAdding());
            GSMCallFixedPrice callPrice = new GSMCallFixedPrice();

            Console.WriteLine(callPrice.CalculatePrice());
        }
        static void Main()
        {
            Console.WriteLine(new string('-', 79));
            Console.WriteLine("GSM tests: ");
            Console.WriteLine(new string('-', 79));
            GSM[] phones = GSMTest.GeneratePhones();
            for (int i = 0; i < phones.Length; i++)
            {
                Console.WriteLine(phones[i].ToString());
            }

            Console.WriteLine(new string('-', 79));
            Console.WriteLine("Call history tests: ");
            Console.WriteLine(new string('-', 79));
            Console.WriteLine("Phone: {0} \n", phones[1].Model);

            GSMCallHistoryTest.GenerateCallHistory(phones[1]);

            Console.WriteLine("Initial call history: \n");

            GSMCallHistoryTest.PrintHistory(phones[1]);

            Console.WriteLine();
            Console.WriteLine("Total call prices: {0}", phones[1].CalculateTotalCallsPrices(0.37f));

            // Remove the longest duration
            int max = phones[1].CallHistory.Max(x => x.Duration);

            phones[1].CallHistory = phones[1].CallHistory.Where(x => x.Duration != max).ToList();

            Console.WriteLine();
            Console.WriteLine("New call history: \n");

            // Print after removal
            GSMCallHistoryTest.PrintHistory(phones[1]);

            Console.WriteLine();
            Console.WriteLine("Total call prices (after longest call removal): {0}", phones[1].CalculateTotalCallsPrices(0.37f));

            phones[1].ClearCallHistory();

            // Print after erasing
            Console.WriteLine();
            Console.WriteLine("Call history after clearing: ");
            GSMCallHistoryTest.PrintHistory(phones[1]);
        }
Example #10
0
        static void Main()
        {
            //Create an array of few instances of the GSM class.
            GSM[] mobilePhones =
            {
                new GSM("Xperia",      "Sony",    350.00M, "Viktor",   new Battery("3310", 150, 300, BatteryType.NiCd), new Display(3.6f, 16000000)),
                new GSM("Galaxy SIII", "Samsung", 899.99M, "Daniel",   new Battery("Me",   120, 240, BatteryType.NiMH), new Display(4.3f, 16000000)),
                new GSM("Galaxy SII",  "Samsung",     600, "Valentin", new Battery("Me",    96, 192, BatteryType.NiMH), new Display(4.1f, 16000000)),
                GSM.IPhone4S
            };

            //Display the information about the GSMs in the array.
            //Display the information about the static property IPhone4S.
            foreach (GSM gsm in mobilePhones)
            {
                Console.WriteLine(gsm);
                Console.WriteLine();
            }

            Console.WriteLine("And the calls test now...\n");
            GSMCallHistoryTest.CallHistoryTest();
        }
Example #11
0
        static void Main(string[] args)

        {
            GSM     gsm     = new GSM("", "", "", 3, new Display(5, "b/w"), new Battery(), new List <Call>());
            Battery battery = new Battery("NK5-P", 72, 16);
            Display display = new Display(4.7, "16M");

            //Print the GSM
            Console.WriteLine("\nGSM\n" + new string('-', 40));
            Console.WriteLine(gsm.ToString());

            //Print the static property IPhone4S
            Console.WriteLine("\niPhone static property\n" + new string('-', 40));
            Console.WriteLine(GSM.IPhone4S.ToString());

            Console.WriteLine("\nCreate list of phones\n" + new string('-', 40));
            GSMTest.CreateListOfPhones();


            Console.WriteLine("\nTest Call history\n" + new string('-', 40));
            GSMCallHistoryTest.CreateCallHistory();
        }
 static void Main()
 {
     GSMTest.TestGSMClass();
     GSMCallHistoryTest.TestGSMCallHistory();
 }
 private static void Main()
 {
     GSMTest.PrintIPhone4S();
     GSMTest.PrintHandysInformation();
     GSMCallHistoryTest.CallHistorySimulation();
 }
Example #14
0
 public static void Main()
 {
     GSMTest.PrintPhones();                   // Problem 7
     GSMCallHistoryTest.CallsHistoryTest();   // Problem 12
 }