Ejemplo n.º 1
0
 /// <summary>
 /// Array sorting method
 /// </summary>
 /// <param name="sender">
 /// Button sender
 /// </param>
 /// <param name="e">
 /// Operation name
 /// </param>
 public void ArraySort(object sender, EventArgs e)
 {
     try
     {
         double[] mas        = ValidationArrays.GetArray(InputFirstTextBox);
         string   nameButton = ((Button)sender).Name;
         ISorter  Factory    = ArraySortFactory.CreateSort(nameButton);
         double[] massive    = Factory.Sort(mas);
         string   result     = "";
         for (int j = 0; j < massive.Length; j++)
         {
             result += Convert.ToString(massive[j] + " ");
         }
         Result.Text = result;
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 2
0
 public void OperationForLog()
 {
     Type resultType = ArraySortFactory.CreateSort("SelectSort").GetType();
 }
Ejemplo n.º 3
0
        public void FactoryTest(Type type, string name)
        {
            Type resultType = ArraySortFactory.CreateSort(name).GetType();

            Assert.AreEqual(type, resultType);
        }