Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ningyougang committed Jul 26, 2022
1 parent bfc0418 commit b5c1672
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 @@ -231,4 +231,17 @@ class DotNet2_2ActionContainerTests extends BasicActionRunnerTests with WskActor
(o + e).toLowerCase should include("the action returned null")
})
}

it should "support array result" in {
val (out, err) = withActionContainer() { c =>
val (initCode, _) =
c.init(
initPayload(functionb64, "Apache.OpenWhisk.Tests.Dotnet::Apache.OpenWhisk.Tests.Dotnet.HelloArray::Main"))
initCode should be(200)

val (runCode, runRes) = c.runForJsArray(JsObject())
runCode should be(200)
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,17 @@ class DotNet3_1ActionContainerTests extends BasicActionRunnerTests with WskActor
(o + e).toLowerCase should include("the action returned null")
})
}

it should "support array result" in {
val (out, err) = withActionContainer() { c =>
val (initCode, _) =
c.init(
initPayload(functionb64, "Apache.OpenWhisk.Tests.Dotnet::Apache.OpenWhisk.Tests.Dotnet.HelloArray::Main"))
initCode should be(200)

val (runCode, runRes) = c.runForJsArray(JsObject())
runCode should be(200)
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,17 @@ class DotNet3_1ActionContainerTests_2_2 extends BasicActionRunnerTests with WskA
(o + e).toLowerCase should include("the action returned null")
})
}

it should "support array result" in {
val (out, err) = withActionContainer() { c =>
val (initCode, _) =
c.init(
initPayload(functionb64, "Apache.OpenWhisk.Tests.Dotnet::Apache.OpenWhisk.Tests.Dotnet.HelloArray::Main"))
initCode should be(200)

val (runCode, runRes) = c.runForJsArray(JsObject())
runCode should be(200)
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
}
}
}

0 comments on commit b5c1672

Please sign in to comment.