Exemple #1
0
        static private void SampleChangeParametersOfToysOnSquareTest(ToysSquareSample square)
        {
            const int depth  = 20;
            const int speed  = 40;
            const int height = 30;

            square.PrintToysSquareState();
            square.ChangeToysParameters(depth, height, speed);
            square.PrintToysSquareState();
        }
Exemple #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);
     }
 }
Exemple #3
0
 static private void AddToysListToSquareSampleTest(ToysSquareSample square, ICollection <IToy> toys)
 {
     foreach (IToy toy in toys)
     {
         try
         {
             square.AddToyToSquare(toy);
         }
         catch (ValueExceedException ex)
         {
             Console.Error.WriteLine(ex.Message);
         }
         catch (ToysAmountExceedException ex)
         {
             Console.Error.WriteLine(ex.Message);
         }
     }
 }
Exemple #4
0
        static void Main(string[] args)
        {
            uint               maxToysNumber  = 15000;
            decimal            maxToysValue   = 500000.50M;
            int                incrementValue = 200;
            ToysSquareSample   square         = new ToysSquareSample(new ToysSquare(), maxToysNumber, maxToysValue);
            ICollection <IToy> toysList       = GetOneExampleEachToyList();

            AddToysListToSquareSampleTest(square, toysList);
            SampleChangeParametersOfToysOnSquareTest(square);
            CreateAdditionalToysTest(square);
            IncrementPriceOfToysTest(toysList, incrementValue);

            square.RemoveFirstToyFromSquareEndlessly();
            square.ChangeToysParametersEndlessly();
            square.AddToysToSquareEndlessly();

            Console.ReadKey();
        }