??Visual Studio 2012?????????
???????????? ???????[ 2014/12/9 14:28:17 ] ??????????????? ??????? VS
???????????
????public class XmlSerialization
????{
????private string filePath;
????public XmlSerialization(string filePath)
????{
????this.filePath=filePath;
????}
????public bool WriteXml<T>(T model??string filePath=null)where T:class
????{
????bool result=false;
????if(model==null)
????{
????return result;
????}
????if(string.IsNullOrEmpty(filePath))
????{
????filePath=this.filePath;
????}
????XmlSerializer serializer=new XmlSerializer(typeof(T));
????using(TextWriter tr=new StreamWriter(filePath))
????{
????serializer.Serialize(tr??model);
????tr.Close();
????result=true;
????}
????return result;
????}
????public T ReadXml<T>(string filePath=null)where T:class
????{
????T model=null;
????if(string.IsNullOrEmpty(filePath))
????{
????filePath=this.filePath;
????}
????XmlSerializer serializer=new XmlSerializer(typeof(T));
????TextReader tr=null;
????try
????{
????tr=new StreamReader(filePath);
????model=(T)serializer.Deserialize(tr);
????}
????catch{}
????finally
????{
????if(tr!=null)
????{
????tr.Close();
????tr.Dispose();
????}
????}
????return model;
????}
????}
???????????
???????????????????????????????????????????л??????·??????????????????????????????????????β?????е???????????????????????????????????“????Attribute[TestInitialize]”??????????public??????????private???????в???????????????????????????£?
???????????
????[TestClass]
????public class XmlSerializationTest
????{
????private XmlSerialization serialization;
????[TestInitialize]
????public void InitTest()
????{
????this.serialization=new XmlSerialization(@"F:usermodel.seri");
????}
????[TestMethod]
????public void TestWriteXml()
????{
????UserModel user=new UserModel();
????bool flag=serialization.WriteXml<UserModel>(user);
????Assert.IsTrue(flag);
????Assert.IsFalse(serialization.WriteXml<UserModel>(null));
????}
????[TestMethod]
????public void TestReadXml()
????{
????UserModel user=new UserModel();
????user.LoginName="aa";
????serialization.WriteXml<UserModel>(user);
????UserModel model=serialization.ReadXml<UserModel>();
????Assert.IsNotNull(model);
????Assert.AreEqual(user.LoginName??model.LoginName);
????//·??????????????null
????UserModel modelnull=serialization.ReadXml<UserModel>(@"F: otexists.seri");
????Assert.IsNull(modelnull);
????}
????}
???????????
????????????????????????????????????????????????????“????”?μ??????
???????????治?????????????????????????????
????????XmlSerializationTest????????????????????????????????????????????????????
?????????????????TFS????????????????????????TFS???檔
?????????
????VS????????????????????UI????????о????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
iOS???????mocha??chai??sinon??istanbul???????????????????????????????????????д?????Java????????7??????Android?????????Robolectric3.0????(?)???Kiwi?????????????????????????????????Python?????????????????????????????????????Controller????????д?????????10???????????????????Angular????????????Component??Directive??Pipe ???ServiceAndroid????????????????????????????????--Mockito??????iOS UnitTest???????Vue?????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????