public void TestMethod1() { var wtf = new FormSample { Name = "Misha", Date = DateTime.Now, Product = new List <Product>() { new Product() { Type = Staff.Electronics, ProductName = "Laptop", Description = "Vax nout", Count = 2, } }, Address = new List <Address>() { new Address() { Сountry = Сountry.RussianFederation, Region = "Sverdlovskaya obl.", City = "Ekaterinbyrg", Index = 148822, Phone = "+7 (800) 555-35-35", } } }; Assert.AreEqual(wtf.Name, "Misha"); }
private void Saver(FormSample wtf) { if (comboBox1.SelectedIndex == 0) { wtf.Product.Type = Staff.Electronics; } if (comboBox1.SelectedIndex == 1) { wtf.Product.Type = Staff.Clothes; } if (comboBox1.SelectedIndex == 2) { wtf.Product.Type = Staff.Cosmetics; } if (comboBox2.SelectedIndex == 0) { wtf.Address.Gos = Сountry.RussianFederation; } if (comboBox2.SelectedIndex == 1) { wtf.Address.Gos = Сountry.China; } if (comboBox2.SelectedIndex == 2) { wtf.Address.Gos = Сountry.India; } }
private void Setter(FormSample wtf) { if (wtf.Product.Type == Staff.Electronics) { comboBox1.SelectedIndex = 0; } if (wtf.Product.Type == Staff.Clothes) { comboBox1.SelectedIndex = 1; } if (wtf.Product.Type == Staff.Cosmetics) { comboBox1.SelectedIndex = 2; } if (wtf.Address.Gos == Сountry.RussianFederation) { comboBox2.SelectedIndex = 0; } if (wtf.Address.Gos == Сountry.China) { comboBox2.SelectedIndex = 1; } if (wtf.Address.Gos == Сountry.India) { comboBox2.SelectedIndex = 2; } }
private void btnShowSampleFormSingleLanguage_Click(object sender, EventArgs e) { FormSample _f = new FormSample(); _f.CurrentCultureName = cboSamplesLanguages.SelectedValue.ToString(); _f.ShowDialog(this); }
private void SetModelToUI(FormSample wtf) { textBox1.Text = wtf.Name; textBox3.Text = wtf.Product.ProductName; textBox2.Text = wtf.Product.Description; numericUpDown1.Value = wtf.Product.Count; textBox4.Text = wtf.Address.Region; textBox5.Text = wtf.Address.City; textBox6.Text = wtf.Address.Index; textBox7.Text = wtf.Address.Phone; }