public void TestBinaryPathOnNoMoreFallback() { tunnel = new TunnelClass(); tunnel.addBinaryPath("dummyPath"); tunnel.fallbackPaths(); tunnel.fallbackPaths(); tunnel.fallbackPaths(); Assert.Throws(typeof(Exception), new TestDelegate(testFallbackException), "Binary not found or failed to launch. Make sure that BrowserStackLocal.exe is not already running." ); }
public void TestBinaryPathOnFallback() { string expectedPath = "dummyPath"; tunnel = new TunnelClass(); tunnel.addBinaryPath("dummyPath"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); tunnel.fallbackPaths(); expectedPath = Path.Combine(Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%"), ".browserstack"); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); tunnel.fallbackPaths(); expectedPath = Directory.GetCurrentDirectory(); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); tunnel.fallbackPaths(); expectedPath = Path.GetTempPath(); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); }
public void TestBinaryPathOnNoMoreFallback() { tunnel = new TunnelClass(); tunnel.addBinaryPath("dummyPath"); tunnel.fallbackPaths(); tunnel.fallbackPaths(); tunnel.fallbackPaths(); Assert.Throws(typeof(Exception), new TestDelegate(testFallbackException), "No More Paths to try. Please specify a binary path in options." ); }