示例#1
0
文件: Program.cs 项目: Foxman13/thali
        public static void Main(string[] args)
        {
            bool synchronous;

            if (args.Length == 0)
            {
                synchronous = false;
            }
            else
            {
                // I think Google Native Host sends random stuff on the command line so if there is an argument and I
                // can't convert it to a bool then I assume it's them and use parallel.
                try
                {
                    synchronous = Convert.ToBoolean(args[0]);
                }
                catch (FormatException)
                {
                    synchronous = false;
                }
            }

            XmlHttpRequestProxy.MainLoop(synchronous);
            //foo();
            //bar();
        }
示例#2
0
文件: Program.cs 项目: Foxman13/thali
        public static void bar()
        {
            var tempDirectoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            var tempDirectory     = Directory.CreateDirectory(tempDirectoryPath);

            var clientCert = ThaliClientToDeviceHubUtilities.GetLocalClientCertificate(tempDirectory);

            var testGetJsonString = GenerateXmlHttpRequestJsonObjectForNonExistentDatabase();

            var xmlHttpRequest  = JsonConvert.DeserializeObject <XmlHttpRequest>(testGetJsonString);
            var xmlHttpResponse = (XmlHttpResponse)XmlHttpRequestProxy.ProcessMessage(xmlHttpRequest, clientCert);

            //Assert.AreEqual(xmlHttpResponse.status, 404);


            xmlHttpResponse = (XmlHttpResponse)XmlHttpRequestProxy.ProcessMessage(xmlHttpRequest, clientCert);
            xmlHttpResponse = (XmlHttpResponse)XmlHttpRequestProxy.ProcessMessage(xmlHttpRequest, clientCert);
            xmlHttpResponse = (XmlHttpResponse)XmlHttpRequestProxy.ProcessMessage(xmlHttpRequest, clientCert);
            xmlHttpResponse = (XmlHttpResponse)XmlHttpRequestProxy.ProcessMessage(xmlHttpRequest, clientCert);
            xmlHttpResponse = (XmlHttpResponse)XmlHttpRequestProxy.ProcessMessage(xmlHttpRequest, clientCert);
        }