Skip to content

Commit 7a89a86

Browse files
committed
Merge pull request #8 from browserstack/net_2_0
Net 2 0
2 parents b12a450 + 894548d commit 7a89a86

File tree

9 files changed

+41
-27
lines changed

9 files changed

+41
-27
lines changed

BrowserStackLocal.0.2.0.0.nupkg

-9.63 KB
Binary file not shown.

BrowserStackLocal.1.0.0.0.nupkg

8.86 KB
Binary file not shown.

BrowserStackLocal/BrowserStackLocal Unit Tests/LocalTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void TestWorksWithAccessKeyInOptions()
5757
local.setTunnel(tunnelMock.Object);
5858
Assert.DoesNotThrow(new TestDelegate(startWithOptions),
5959
"BROWSERSTACK_ACCESS_KEY cannot be empty. Specify one by adding key to options or adding to the environment variable BROWSERSTACK_KEY.");
60-
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile " + logAbsolute), Times.Once());
60+
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile \"" + logAbsolute + "\" "), Times.Once());
6161
tunnelMock.Verify(mock => mock.Run("dummyKey", "", logAbsolute, "start"), Times.Once());
6262
local.stop();
6363
}
@@ -73,7 +73,7 @@ public void TestWorksWithAccessKeyNotInOptions()
7373
local.setTunnel(tunnelMock.Object);
7474
Assert.DoesNotThrow(new TestDelegate(startWithOptions),
7575
"BROWSERSTACK_ACCESS_KEY cannot be empty. Specify one by adding key to options or adding to the environment variable BROWSERSTACK_KEY.");
76-
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile " + logAbsolute), Times.Once());
76+
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile \"" + logAbsolute + "\" "), Times.Once());
7777
tunnelMock.Verify(mock => mock.Run("envDummyKey", "", logAbsolute, "start"), Times.Once());
7878
local.stop();
7979
}
@@ -90,7 +90,7 @@ public void TestWorksForFolderTesting()
9090
tunnelMock.Setup(mock => mock.Run("dummyKey", "dummyFolderPath", logAbsolute, "start"));
9191
local.setTunnel(tunnelMock.Object);
9292
local.start(options);
93-
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile " + logAbsolute), Times.Once());
93+
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile \"" + logAbsolute + "\" "), Times.Once());
9494
tunnelMock.Verify(mock => mock.Run("dummyKey", "dummyFolderPath", logAbsolute, "start"), Times.Once());
9595
local.stop();
9696
}
@@ -108,7 +108,7 @@ public void TestWorksForBinaryPath()
108108
local.setTunnel(tunnelMock.Object);
109109
local.start(options);
110110
tunnelMock.Verify(mock => mock.addBinaryPath("dummyPath"), Times.Once);
111-
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile " + logAbsolute), Times.Once());
111+
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile \"" + logAbsolute + "\" "), Times.Once());
112112
tunnelMock.Verify(mock => mock.Run("dummyKey", "", logAbsolute, "start"), Times.Once());
113113
local.stop();
114114
}
@@ -201,7 +201,7 @@ public void TestCallsFallbackOnFailure()
201201
local.setTunnel(tunnelMock.Object);
202202
local.start(options);
203203
tunnelMock.Verify(mock => mock.addBinaryPath(""), Times.Once);
204-
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile " + logAbsolute), Times.Once());
204+
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile \"" + logAbsolute + "\" "), Times.Once());
205205
tunnelMock.Verify(mock => mock.Run("dummyKey", "", logAbsolute, "start"), Times.Exactly(2));
206206
tunnelMock.Verify(mock => mock.fallbackPaths(), Times.Once());
207207
local.stop();
@@ -220,7 +220,7 @@ public void TestKillsTunnel()
220220
local.start(options);
221221
local.stop();
222222
tunnelMock.Verify(mock => mock.addBinaryPath(""), Times.Once);
223-
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile " + logAbsolute), Times.Once());
223+
tunnelMock.Verify(mock => mock.addBinaryArguments("-logFile \"" + logAbsolute + "\" "), Times.Once());
224224
tunnelMock.Verify(mock => mock.Run("dummyKey", "", logAbsolute, "start"), Times.Once());
225225
}
226226

BrowserStackLocal/BrowserStackLocal/BrowserStackLocal.csproj

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>BrowserStack</RootNamespace>
1111
<AssemblyName>BrowserStackLocal</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
1415
</PropertyGroup>
1516
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1617
<DebugSymbols>true</DebugSymbols>
@@ -32,24 +33,35 @@
3233
</PropertyGroup>
3334
<ItemGroup>
3435
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
35-
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
36+
<HintPath>..\packages\log4net.2.0.5\lib\net20-full\log4net.dll</HintPath>
3637
<Private>True</Private>
3738
</Reference>
3839
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
39-
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
40+
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net20\Newtonsoft.Json.dll</HintPath>
4041
<Private>True</Private>
4142
</Reference>
42-
<Reference Include="nunit.framework, Version=3.0.5813.39031, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
43-
<HintPath>..\packages\NUnit.3.0.1\lib\net45\nunit.framework.dll</HintPath>
43+
<Reference Include="nunit.core, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
44+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll</HintPath>
45+
<Private>False</Private>
46+
</Reference>
47+
<Reference Include="nunit.core.interfaces, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
48+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll</HintPath>
49+
<Private>False</Private>
50+
</Reference>
51+
<Reference Include="nunit.framework, Version=3.2.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
52+
<HintPath>..\packages\NUnit.3.2.1\lib\net20\nunit.framework.dll</HintPath>
4453
<Private>True</Private>
4554
</Reference>
55+
<Reference Include="nunit.util, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
56+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll</HintPath>
57+
<Private>False</Private>
58+
</Reference>
59+
<Reference Include="NUnit.VisualStudio.TestAdapter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4cb40d35494691ac, processorArchitecture=MSIL">
60+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
61+
<Private>False</Private>
62+
</Reference>
4663
<Reference Include="System" />
47-
<Reference Include="System.Core" />
48-
<Reference Include="System.Xml.Linq" />
49-
<Reference Include="System.Data.DataSetExtensions" />
50-
<Reference Include="Microsoft.CSharp" />
5164
<Reference Include="System.Data" />
52-
<Reference Include="System.Net.Http" />
5365
<Reference Include="System.Xml" />
5466
</ItemGroup>
5567
<ItemGroup>

BrowserStackLocal/BrowserStackLocal/BrowserStackTunnel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ private void RunProcess(string arguments, string processType)
147147
{
148148
if (e.Data != null)
149149
{
150-
dynamic binaryOutput = JObject.Parse(e.Data);
151-
if(binaryOutput.state != null && !binaryOutput.state.ToString().ToLower().Contains("connected"))
150+
JObject binaryOutput = JObject.Parse(e.Data);
151+
if(binaryOutput.GetValue("state") != null && !binaryOutput.GetValue("state").ToString().ToLower().Equals("connected"))
152152
{
153-
throw new Exception("Eror while executing BrowserStackLocal " + processType);
153+
throw new Exception("Eror while executing BrowserStackLocal " + processType + " " + e.Data);
154154
}
155155
}
156156
});

BrowserStackLocal/BrowserStackLocal/Local.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void start(List<KeyValuePair<string, string>> options)
157157
customLogPath = Path.Combine(BrowserStackTunnel.basePaths[1], "local.log");
158158
}
159159

160-
argumentString += "-logFile " + customLogPath;
160+
argumentString += "-logFile \"" + customLogPath + "\" ";
161161
tunnel.addBinaryPath(customBinaryPath);
162162
tunnel.addBinaryArguments(argumentString);
163163
while (true) {

BrowserStackLocal/BrowserStackLocal/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.2.0.0")]
36-
[assembly: AssemblyFileVersion("0.2.0.0")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="log4net" version="2.0.5" targetFramework="net45" />
4-
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
3+
<package id="log4net" version="2.0.5" targetFramework="net20" />
4+
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net20" />
5+
<package id="NUnit" version="3.2.1" targetFramework="net20" />
6+
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net20" />
57
</packages>

BrowserStackLocalExample/BrowserStackExample/BrowserStackExample.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
<WarningLevel>4</WarningLevel>
4848
</PropertyGroup>
4949
<ItemGroup>
50-
<Reference Include="BrowserStack">
51-
<HintPath>..\..\BrowserStack\BrowserStack\bin\Debug\BrowserStack.dll</HintPath>
52-
</Reference>
5350
<Reference Include="BrowserStackLocal">
5451
<HintPath>..\..\BrowserStackLocal\BrowserStackLocal\bin\Debug\BrowserStackLocal.dll</HintPath>
5552
</Reference>
@@ -86,6 +83,9 @@
8683
<Install>false</Install>
8784
</BootstrapperPackage>
8885
</ItemGroup>
86+
<ItemGroup>
87+
<WCFMetadata Include="Service References\" />
88+
</ItemGroup>
8989
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9090
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9191
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)