/// <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); } }
public void OperationForLog() { Type resultType = ArraySortFactory.CreateSort("SelectSort").GetType(); }
public void FactoryTest(Type type, string name) { Type resultType = ArraySortFactory.CreateSort(name).GetType(); Assert.AreEqual(type, resultType); }