public void TestSaveLoad_DataPackage() { string code = "rb1710"; int start = 20170601; int end = 20170602; int minKLineBefore = 100; int minKLineAfter = 50; IDataPackage_Code dataPackage = DataCenter.Default.DataPackageFactory.CreateDataPackage_Code(code, start, end, minKLineBefore, minKLineAfter); XmlElement root = GetXmlRoot(); dataPackage.Save(root); DataPackage_Code dataPackage2 = (DataPackage_Code)DataCenter.Default.DataPackageFactory.CreateDataPackage_Code(root); Assert.AreEqual(code, dataPackage2.Code); Assert.AreEqual(start, dataPackage2.StartDate); Assert.AreEqual(end, dataPackage2.EndDate); Assert.AreEqual(minKLineBefore, dataPackage2.MinBefore); Assert.AreEqual(minKLineAfter, dataPackage2.MinAfter); }