public void CollabProxyClient_InstantiatedWithoutPortCache_CachesNewPort()
        {
            Assert.IsFalse(File.Exists(CollabProxyClient.GetPortFilePath()));
            TestableCollabProxyClient theClient = new TestableCollabProxyClient();

            Assert.IsTrue(File.Exists(CollabProxyClient.GetPortFilePath()));
            Assert.AreNotEqual(0, TestHelper.GetPortFromFile());
        }
示例#2
0
        public GitProxy(CollabProxyClient tcpClient)
        {
            if (tcpClient == null)
            {
                throw new ArgumentNullException();
            }

            m_TcpClient = tcpClient;
        }
示例#3
0
        public static int GetPortFromFile()
        {
            int serverPort = 0;

            if (File.Exists(CollabProxyClient.GetPortFilePath()))
            {
                using (StreamReader sr = new StreamReader(CollabProxyClient.GetPortFilePath()))
                {
                    int.TryParse(sr.ReadToEnd(), out serverPort);
                }
            }

            return(serverPort);
        }