Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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);
     }
 }