Skip to content

Commit

Permalink
Add Test
Browse files Browse the repository at this point in the history
  • Loading branch information
nokotan committed May 19, 2023
1 parent c7d130f commit 40c6027
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="NodeWebAssemblyDebuggerConfig.test.cs" />
<Compile Include="WebAssemblyDebuggerConfig.test.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Emscripten.Debugger.Definition;
using System;

namespace Emscripten.Debugger.Definition.Test
{
[TestClass]
public class NodeWebAssemblyDebuggerConfigTest
{
[TestMethod]
public void GenerateNodeLaunchConfigFromEmptyStrings()
{
var config = NodeWebAssemblyDebuggerConfig.GenerateNodeLaunchConfig(
program: "",
nodeExecutable: "",
nodeWorkingDirectory: "",
debugAdapterExecutable: ""
);

Assert.AreEqual(config.type, "wasm-node");
Assert.AreEqual(config.cwd, null);
}

[TestMethod]
public void GenerateNodeLaunchConfigFromValidWorkingDirectory()
{
var config = NodeWebAssemblyDebuggerConfig.GenerateNodeLaunchConfig(
program: "",
nodeExecutable: "",
nodeWorkingDirectory: "/foo/bar",
debugAdapterExecutable: ""
);

Assert.AreEqual(config.cwd, "/foo/bar");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public void GenerateChromeLaunchConfigFromEmptyStrings()
debugAdapterExecutable: ""
);

Assert.AreEqual(config.type, "wasm-chrome");
Assert.AreEqual(config.flags.Length, 0);
Assert.AreEqual(config.userDataDir, null);
Assert.AreEqual(config.ignoreDefaultFlags, null);
Expand Down

0 comments on commit 40c6027

Please sign in to comment.