public void SearchResultWithNoRescords() { SearchResult result = new SearchResult("<people></people>"); Record[] records = new Record[0]; Assert.AreEqual(records, result.Records()); }
public void SearchResultRecords() { SearchResult result = new SearchResult("<people><row><name>Tommy</name></row></people>"); XmlDocument doc = new XmlDocument(); XmlElement row = doc.CreateElement("row"); XmlElement name = doc.CreateElement("name"); name.InnerText = "Tommy"; row.AppendChild(name); doc.AppendChild(row); Record[] records = new Record[] { new Record(doc.ChildNodes[0]) }; Assert.AreEqual(records[0]["name"], result.Records()[0]["name"]); }
public Record[] Execute() { int pageNumber = 1; List<Record> allResults = new List<Record>(); Record[] records; string resultXML; do { resultXML = _service.GetSearchResults(_dataset.m_id, ToQueryConditions() + "&" + PaginationParams(pageNumber)); records = new SearchResult(resultXML).Records(); allResults.AddRange(records); pageNumber += 1; } while(records.Length > 0); return allResults.ToArray(); }
public void SearchReultMultipleRecords() { SearchResult result = new SearchResult("<people><row><name>Tommy</name></row><row><name>Billy</name></row></people>"); Assert.Greater(result.Records().Length, 1); }