public void ContainerTestAll() { FillCollection fill = new FillCollection(); Container container = fill.CreateContainer<int>(PointDimensions.X, 10, 10, 10); List<Matrix> list = new List<Matrix>(); list = container.ReturnAll(); int size = 0; foreach (Matrix matr in list) { size += matr.Size(); } Assert.AreEqual(size, container.Size()); }
static void Main(string[] args) { Stopwatch stopWatch = new Stopwatch(); FillCollection fillCollection = new FillCollection(); Printer printer = new Printer(); stopWatch.Start(); ContainersCollection Collection = fillCollection.CreateCollectionContainer<int>(PointDimensions.XY, 1, 50, 400, 500); Console.WriteLine("Memory: "+ printer.CollectionContainerPrint(Collection) +" byte"); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",ts.Hours, ts.Minutes, ts.Seconds,ts.Milliseconds / 10); Console.WriteLine("RunTime " + elapsedTime); Console.Read(); }
static void Main(string[] args) { //try //{ // MobileNumber a = new MobileNumber("6;Kateryna;Korniienko;+38055250;5056;56304892;5000.50;2010-03-09;"); //} //catch //{ // Console.WriteLine("OPPS"); //} ////Console.WriteLine(a); string file_name = Input.ValidateFileName(); Collection <MobileNumber> ls = FillCollection <MobileNumber> .Method(file_name); //Collection<MobileNumber> ls = new Collection<MobileNumber>(); while (true) { Console.WriteLine(@"Input number of option: 1. Search meetings with value 2. Sort by parametr 3. Delete meeting by ID 4. Add meeting 5. Edit meeting by ID 6. See all meetings 7. Exit"); string num = Console.ReadLine(); string val = ""; if (num.All(char.IsDigit) == false) { Console.WriteLine("Number should contain digits!"); continue; } if (Int32.Parse(num) >= 1 && Int32.Parse(num) < 5) { Console.WriteLine("Type value: "); val = Console.ReadLine(); } if (num == "1") { ls.Search(val); } else if (num == "2") { ls.Sort(val); } else if (num == "3") { ls.Remove(val, file_name); } else if (num == "4") { MobileNumber obj = new MobileNumber(); try { obj = new MobileNumber(val); } catch { Console.WriteLine("Rewrite values!"); continue; } ls.AddTo(obj, file_name); } else if (num == "5") { Console.WriteLine("Type id:"); string id = Console.ReadLine(); Console.WriteLine("Type value: "); val = Console.ReadLine(); ls.Edit(id, val, file_name); } else if (num == "6") { ls.Print(); } else { break; } } }