[TestMethod] //Test Case 8 : One Invalid DMS Numbers public void GetAttachmentStatusWithInvalidDmsNumber() { dmsRefNumbers[0] = "890de2b5-ec3a-4b2b-9cab-4a63b1bf9111"; response = AttachmentStatus(ConfigurationManager.AppSettings["GetAttachmentStatus"], dmsRefNumbers); MyResponses statusresponses = JsonConvert.DeserializeObject <MyResponses>(response.Content); //Do Assertion here }
[TestMethod] //Test Case 6 : One DMS Numbers & One InValid FecilityID public void GetAttachmentStatusWithDmsNumberAndInValidFecilityID() { dmsRefNumbers = UploadDocumentToVyne(1); response = AttachmentStatus(ConfigurationManager.AppSettings["GetAttachmentStatus"], dmsRefNumbers, "ABCD123"); MyResponses statusresponses = JsonConvert.DeserializeObject <MyResponses>(response.Content); //Do Assertion here }
[TestMethod] //Test Case 4 : Four DMS Numbers public void GetAttachmentStatusWithFourDmsNumbers() { dmsRefNumbers = UploadDocumentToVyne(4); response = AttachmentStatus(ConfigurationManager.AppSettings["GetAttachmentStatus"], dmsRefNumbers); MyResponses statusresponses = JsonConvert.DeserializeObject <MyResponses>(response.Content); //Do Assertion here }
//IList<string> msgs = new List<string>(); ////[TestMethod] //public IList<string> ResMessages(string msg) //{ // //string msg = "{\"attachmentId\":48494,\"nte\":\"MEA#48494\",\"pwk\":\"MEA48494\"}"; // string[] nmsg = msg.Replace("\""," ").Replace("}", " ").Split(','); // msgs.Add(nmsg[0].Split(':')[1].Trim()); msgs.Add(nmsg[1].Split(':')[1].Trim()); msgs.Add(nmsg[2].Split(':')[1].Trim()); // return msgs; //} public void ValidateGetAttachmentStatus(List <List <RootObject> > MetaDataList, MyResponses myResponses) { string nte = null; string pwk = null; for (int i = 0; i < MetaDataList.Count; i++) { Console.WriteLine("DMS Number :" + i + " - " + myResponses.Responses.ElementAt(i).dmsInternalReferenceNumber); var msgs = RespStatusMessages(MetaDataList.ElementAt(i).ElementAt(i).responseDetails.ResponseMessage); for (int j = 0; j < MetaDataList.Count; j++) { if (MetaDataList.ElementAt(i).ElementAt(0).attachment.dmsInternalReferenceNumber == myResponses.Responses.ElementAt(j).dmsInternalReferenceNumber) { nte = myResponses.Responses.ElementAt(j).nte; pwk = myResponses.Responses.ElementAt(j).nte; } } //Assert.AreEqual(msgs.attachmentId, myResponses.Responses.ElementAt(i).attachmentId); Assert.AreEqual(msgs.nte, nte); Assert.AreEqual(msgs.pwk, pwk); } }
public void ReadStatusResponse() { string JsonFilePath = AppDomain.CurrentDomain.BaseDirectory.Replace("\\bin\\Debug", "\\") + "SeleniumPractice\\EASubmitter\\Data\\AttachmentStatus.json"; //responses = JsonConvert.DeserializeObject<Responses>(File.ReadAllText(JsonFilePath)); MyResponses a = JsonConvert.DeserializeObject <MyResponses>(File.ReadAllText(JsonFilePath)); }
[TestMethod] //Test Case 10 : Two FecilityIDs public void GetAttachmentStatusWithTwoFecilityIDs() { response = AttachmentStatus(ConfigurationManager.AppSettings["GetAttachmentStatus"], "abcd1234", "xyzw123"); MyResponses statusresponses = JsonConvert.DeserializeObject <MyResponses>(response.Content); //Do Assertion here }