2023-05-13 14:30:05 +04:00
|
|
|
|
using BookShopContracts.BusinessLogicsContracts;
|
|
|
|
|
|
|
|
|
|
namespace BookShopView
|
|
|
|
|
{
|
2023-05-17 17:40:36 +04:00
|
|
|
|
public partial class FormTests : Form
|
|
|
|
|
{
|
|
|
|
|
private readonly IBookLogic _bookLogic;
|
|
|
|
|
public FormTests(IBookLogic routeLogic)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
_bookLogic = routeLogic;
|
|
|
|
|
numericUpDownInsert.Minimum = 0;
|
|
|
|
|
numericUpDownInsert.Maximum = 1000000;
|
|
|
|
|
numericUpDownRead.Minimum = 0;
|
|
|
|
|
numericUpDownRead.Maximum = 1000000;
|
|
|
|
|
}
|
2023-05-13 14:30:05 +04:00
|
|
|
|
|
2023-05-17 17:40:36 +04:00
|
|
|
|
private void buttonInsertTest_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var result = _bookLogic.TestInsertList(Convert.ToInt32(numericUpDownInsert.Value));
|
2023-05-13 14:30:05 +04:00
|
|
|
|
|
2023-05-17 17:40:36 +04:00
|
|
|
|
textBoxInsertTime.Text = result;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-13 14:30:05 +04:00
|
|
|
|
|
2023-05-17 17:40:36 +04:00
|
|
|
|
private void buttonReadTest_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var result = _bookLogic.TestReadList(Convert.ToInt32(numericUpDownRead.Value));
|
|
|
|
|
textBoxReadTime.Text = result;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-13 14:30:05 +04:00
|
|
|
|
|
2023-05-17 17:40:36 +04:00
|
|
|
|
private void FormTests_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|