예제 #1
0
        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);
        }
예제 #2
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);
        }
예제 #3
0
        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);
        }