public void ObjectCreatedFromStringShouldGenerateTheSameString() { string agoraRecord = "\"Minha CDN\" GET 200 /robots.txt 100 312 HIT"; AgoraTemplate agoraTemplate = new AgoraTemplate(agoraRecord); Assert.AreEqual("\"Minha CDN\" GET 200 /robots.txt 100 312 HIT", agoraTemplate.ToString()); }
public void MustBePossibleToConvertMinhaCdnRecordToAgoraRecord() { string minhaCdnRecord = "312|200|HIT|\"GET /robots.txt HTTP/1.1\"|100.2"; string expectedAgoraRecord = "\"Minha CDN\" GET 200 /robots.txt 100 312 HIT"; MinhaCdnTemplate minhaCdnTemplate = new MinhaCdnTemplate(minhaCdnRecord); AgoraTemplate agoraTemplate = MinhaCdnToAgoraConverter.ToAgoraTemplate(minhaCdnTemplate); Assert.AreEqual(expectedAgoraRecord, agoraTemplate.ToString()); }
/// <summary> /// Method that convert a list of records from MinhaCdnTemplate to AgoraTemplate /// </summary> /// <param name="minhaCdnRecord">List of records to be converted</param> /// <returns>List of converted records</returns> public static List <AgoraTemplate> ToAgoraTemplate(List <MinhaCdnTemplate> minhaCdnRecords) { List <AgoraTemplate> agoraRecords = new List <AgoraTemplate>(); foreach (MinhaCdnTemplate minhaCdnRecord in minhaCdnRecords) { AgoraTemplate agoraRecord = ToAgoraTemplate(minhaCdnRecord); agoraRecords.Add(agoraRecord); } return(agoraRecords); }