public void CanSerializeExpandoListToJson() { string procedure = "usp_GetLLXDealsCalYearForSharepoint"; var dataProvider = new DataProvider(connection, procedure); var results = dataProvider.ExecuteStoredProcedure(); string json = JsonConvert.SerializeObject(results); Assert.IsTrue(json.Length > 0); }
public void CanSerializeListOfDynamicToXML() { //usp_GetLLXDealsCalYearForSharepoint var dataProvider = new DataProvider(connection, "usp_GetLLXCalYearForSharepoint"); var results = dataProvider.ExecuteStoredProcedure(); string json = JsonConvert.SerializeObject(results); string rootStart = @"{'root' : {'records' : "; string end = @"}}"; json = rootStart + json + end; System.Xml.XmlNode myXmlNode = (XmlNode)JsonConvert.DeserializeXmlNode(json); Console.WriteLine(myXmlNode.InnerXml); Assert.IsTrue(myXmlNode.InnerXml.Length > 1); }
public void CanExecuteStoredProcedure() { string procedure = "usp_GetLLXDealsCalYearForSharepoint"; var dataProvider = new DataProvider(connection, procedure); var results = dataProvider.ExecuteStoredProcedure(); int actualCount = StoredProcedureCount(procedure); Assert.AreEqual(results.Count, actualCount); }