public void Reply_CurrentUser_Not_Initialized() { var rs = new RiveScriptEngine(); var oh = new CSharpObjectHandler(rs); oh.Load("test", new string[] { "return rs.currentUser();" }); var result = oh.Call("test", rs, new string[] { "" }); Assert.AreEqual(Constants.Undefined, result); }
public void Reply_RS_Instance() { var rs = new RiveScriptEngine(); var oh = new CSharpObjectHandler(rs); oh.Load("test", new string[] { "return rs.GetHashCode().ToString(); " }); var result = oh.Call("test", rs, new string[] { "" }); Assert.AreEqual(rs.GetHashCode().ToString(), result); }
public void Reply_Concatenet_Args_Id() { var rs = new RiveScriptEngine(); var oh = new CSharpObjectHandler(rs); oh.Load("test", new string[] { "return String.Join(\",\", args); " }); var result = oh.Call("test", rs, new string[] { "1", "2", "3" }); Assert.AreEqual("1,2,3", result); }
public void Hello_World_Simple_Code_AndChsrpHandlerIsDefault() { var rs = new RiveScriptEngine(); var oh = new CSharpObjectHandler(rs); oh.Load("test", new string[] { "return \"Hello world\"; " }); var result = oh.Call("test", rs, new string[] { "" }); Assert.AreEqual("Hello world", result); }