Skip to content

Commit

Permalink
chore: Simplify member access in AppiumLocalServerLaunchingTest (#626)
Browse files Browse the repository at this point in the history
* chore: Simplify member access in AppiumLocalServerLaunchingTest

* chore: Avoid initializing bytes as null and adjust bytes variable placement
  • Loading branch information
Dor-bl authored Aug 10, 2023
1 parent 1281c06 commit a6df44d
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public class AppiumLocalServerLaunchingTest
[OneTimeSetUp]
public void BeforeAll()
{
byte[] bytes = null;

var isWindows = Platform.CurrentPlatform.IsPlatformType(PlatformType.Windows);
var isMacOs = Platform.CurrentPlatform.IsPlatformType(PlatformType.Mac);
var isLinux = Platform.CurrentPlatform.IsPlatformType(PlatformType.Linux);
Expand All @@ -43,22 +41,23 @@ public void BeforeAll()
}
Console.WriteLine(_testIp);

byte[] bytes;
if (isWindows)
{
bytes = Resources.PathToWindowsNode;
_pathToCustomizedAppiumJs = System.Text.Encoding.UTF8.GetString(bytes);
_pathToCustomizedAppiumJs = Encoding.UTF8.GetString(bytes);
return;
}
if (isMacOs)
{
bytes = Resources.PathToMacOSNode;
_pathToCustomizedAppiumJs = System.Text.Encoding.UTF8.GetString(bytes);
_pathToCustomizedAppiumJs = Encoding.UTF8.GetString(bytes);
return;
}
if (isLinux)
{
bytes = Resources.PathToLinuxNode;
_pathToCustomizedAppiumJs = System.Text.Encoding.UTF8.GetString(bytes);
_pathToCustomizedAppiumJs = Encoding.UTF8.GetString(bytes);
return;
}
}
Expand Down

0 comments on commit a6df44d

Please sign in to comment.