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 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);
        }