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