static ICollection <IToy> GetOneExampleEachToyList() { ICollection <IToy> toysList = new LinkedList <IToy>(); toysList.Add(Car.CreateSampleCar()); toysList.Add(Plane.CreateSamplePlane()); toysList.Add(Submarine.CreateSampleSubmarine()); toysList.Add(Computer.CreateSampleComputer()); return(toysList); }
static private void CreateAdditionalToysTest(ToysSquareSample square) { try { square.AddToyToSquare(Submarine.CreateSampleSubmarine()); square.AddToyToSquare(Computer.CreateSampleComputer()); } catch (ValueExceedException ex) { Console.Error.WriteLine(ex.Message); } catch (ToysAmountExceedException ex) { Console.Error.WriteLine(ex.Message); } }