예제 #1
0
        public void Get_Test()
        {
            bool ret = tubeXMLPullTest.Get(TubeCredentials.app_dir, TubeCredentials.app_id, TubeCredentials.app_key);

            Assert.IsTrue(ret, "Func: 'tubeXMLPull::Get(TubeCredentials.app_dir, TubeCredentials.app_id, TubeCredentials.app_key)' - should be true");
            ret = tubeXMLPullTest.Get("C:/Test.XML", TubeCredentials.app_id, TubeCredentials.app_key);
            Assert.IsFalse(ret, "Func: 'tubeXMLPull::Get('C:/ Test.XML', TubeCredentials.app_id, TubeCredentials.app_key)' - should be false - Permission Denied for C drive root");
            ret = tubeXMLPullTest.Get("", "", "");
            Assert.IsFalse(ret, "Func: 'tubeXMLPull::Get('', '', '')' - should be false - Empty Parameters");
        }
예제 #2
0
        public static void Main(string[] args)
        {
            TubeXMLPull tubeXMLPull = new TubeXMLPull();
            //private credentials, directory to save the xml file too, app id and app key can be requested from TFL
            bool xmlPullSuccess = tubeXMLPull.Get(TubeCredentials.app_dir, TubeCredentials.app_id, TubeCredentials.app_key);

            if (xmlPullSuccess)
            {
                TubeXMLParser tubeXML = new TubeXMLParser();
                //parse and read the xml file
                if (tubeXML.Load(TubeCredentials.app_dir))
                {
                    tubeXML.Read();
                }
            }
        }