public void AddElementTest() { Company company = new Company("ООО НИЛЬС", "ООО НИЛЬС", "000000001", "ООО"); Company company1 = new Company("LLC Vesta", "LLC Vesta", "000000002", "LLC"); CompanyDataController companyDataController = new CompanyDataController(company); companyDataController.AddElement(company1); Assert.AreEqual(2, companyDataController.Count); }
private void addCompanyDataButton_Click(object sender, EventArgs e) { CompanyForm companyAddForm = new CompanyForm(); DialogResult dialogResult = companyAddForm.ShowDialog(this); if (dialogResult == DialogResult.Cancel) { return; } var newCompany = new Company(companyAddForm.companyFullNameTextBox.Text, companyAddForm.companyShortNameTextBox.Text, companyAddForm.companyTINTextBox.Text); controller.AddElement(newCompany); companyDataGridView.DataSource = controller.Elements; }