public void FirstTest() { var dto = new PizzaRequestDto { //Filled = DateTime.Now, FullName = "Batman", Address = "Batcave", Price = 700, PaymentMethod = PaymentMethod.CreditCardOnline, DeliveryTime = new DateTime(2018, 4, 22, 23, 15, 0), Pizza = new List <PizzaMaker>() { new PizzaMaker { pizza = Pizza.Margherita, size = PizzaSize.large, Dough = DoughType.TraditionalDough, AddMushrooms = false } } }; var tempFileName = Path.GetTempFileName(); try { PizzaDtoHelper.WriteToFile(tempFileName, dto); var readDto = PizzaDtoHelper.LoadFromFile(tempFileName); // Assert.AreEqual(dto.Filled, readDto.Filled); Assert.AreEqual(dto.Address, readDto.Address); } finally { File.Delete(tempFileName); } }
private void OpenB_Click(object sender, EventArgs e) { var ofd = new OpenFileDialog() { Filter = "Файл заказа|*.pz" }; var result = ofd.ShowDialog(this); if (result == DialogResult.OK) { var dto = PizzaDtoHelper.LoadFromFile(ofd.FileName); SetModelToUI(dto); } IsNull(); }