static void Main() { //Task 7 var test = new GSMTest(); test.DisplayInfo(); //Task 12 var callHistoryTest = new CallHistoryTest(); callHistoryTest.TestCallHistory(); }
static void Main() { decimal price = .37M; Gsm[] gsms = new Gsm[2]; // GSM 0 { gsms[0] = Gsm.IPhone4S; } // GSM 1 { Display display = new Display(480, 900, 65000); Battery battery = new Battery(Battery.Type.LiIon, 50, 10); gsms[1] = new Gsm("Desire", "Htc", "Dido", 345.54m, display, battery); gsms[1].CallHistory.Add(new Call("234234", new TimeSpan(1, 7, 10))); // Hours, Minutes, Seconds gsms[1].CallHistory.Add(new Call("234142", new TimeSpan(0, 4, 20))); gsms[1].CallHistory.Add(new Call("2314234", new TimeSpan(1, 4, 0))); gsms[1].CallHistory.Add(new Call("42314256", new TimeSpan(0, 1, 20))); } // Print Console.WriteLine(gsms[0].ToString()); Console.WriteLine(); Console.WriteLine(gsms[1].ToString()); Console.WriteLine(); // CALL TEST CallHistoryTest callHistoryTest = new CallHistoryTest(gsms[1].CallHistory); // Calculate price callHistoryTest.GetPrice(price); // Remove call callHistoryTest.Remove(id: 2); // Calculate price callHistoryTest.GetPrice(price); // Remove longest call callHistoryTest.RemoveLongestCall(); // Calculate price callHistoryTest.GetPrice(price); // Clear call history callHistoryTest.ClearHistory(); }
static void Main(string[] args) { // Problem 7 Console.WriteLine("Testing Class GSM"); foreach (GSM gsm in GsmTest.gsms) { Console.WriteLine(gsm.ToString()); } Console.WriteLine("To see more test results, press any key..."); Console.ReadKey(); Console.Clear(); // Problem 12 Console.WriteLine("Testing Call History"); CallHistoryTest.TestCallHistory(); }
static void Main(string[] args) { //InitialValue is number of phones you want to create GSMTest.InitalValue = 10; var phoneGenerator = new GSMTest(); //creating random phones phoneGenerator.GeneratePhonesTest(); phoneGenerator.PrintPhones(); var myCalls = new CallHistoryTest(); //Creating phone with 3 calls in it myCalls.TestPhone(); myCalls.ToString(); //Removing the Longest Call from the History plus friendly messege myCalls.RemoveLongestCall(); myCalls.ToString(); //Clear all the calls from the history myCalls.ClearHistory(); myCalls.ToString(); }
static void Main() { GSMTest.DevicesTest(); CallHistoryTest.CallHistory(); }