public void CreateTest() { IFile XmlFile = FactoryProvider.getFactory(PersitenseTypes.FILE).Create(FileTypes.xml); Student addedStudent = XmlFile.Create(student); Assert.AreEqual(student, addedStudent); }
private void BtnList_Click(object sender, EventArgs e) { string choice = "VuelingFile"; var factory = FactoryProvider.getFactory(choice); var fileFactory = factory.Create((ComboBox.SelectedItem.ToString())); MessageBox.Show(fileFactory.List()); }
public void DeleteTest() { IFile textFile = FactoryProvider.getFactory(PersitenseTypes.FILE).Create(FileTypes.txt); Student newStudent = textFile.Create(student); Assert.IsTrue(textFile.Delete(newStudent)); }
private void BtnUpdate_Click(object sender, EventArgs e) { Student student = new Student(int.Parse(txtBoxStudentId.Text), txtBoxName.Text, txtBoxSurname.Text, DateTime.Parse(txtBoxBirthDate.Text)); string choice = "VuelingFile"; var factory = FactoryProvider.getFactory(choice); var fileFactory = factory.Create((ComboBox.SelectedItem.ToString())); fileFactory.Update(student); }
public void AllTest() { IFile textFile = FactoryProvider.getFactory(PersitenseTypes.FILE).Create(FileTypes.txt); Student newStudent = textFile.Create(student); Student newStudent2 = textFile.Create(student2); Assert.AreEqual(newStudent.Name, textFile.All()[0].Name); Assert.AreEqual(newStudent2.Name, textFile.All()[1].Name); }
public void CreatesTest() { IFile textFile = FactoryProvider.getFactory(PersitenseTypes.FILE).Create(FileTypes.txt); Student newStudent = textFile.Create(student); Assert.AreEqual(student, newStudent); }
private static void Commands() { Student student = new Student(10, "Sergi", "Virgilius", 2000); Student student2 = new Student(11, "VIRIVIR", "asdasad", 2012); IFile file = FactoryProvider.getFactory(PersitenseTypes. FILE).Create(FileTypes.txt); file.Delete(student2); }