public void TestCreateCommand_ValidArgs() { string cmdText = "b=a*a"; MatlabEngine engine = new MatlabEngine(); MatlabCommand cmd = engine.CreateCommand(cmdText); SingleStatementMatlabCommand theCmd = cmd as SingleStatementMatlabCommand; Assert.AreEqual(cmdText, theCmd.Input); }
public void TestConstructor_ValidArgs() { string cmdInput = "b=a*a"; MLAppClass matlab = MatlabTestInstance.Instance; MatlabSession session = new MatlabSession(matlab); SingleStatementMatlabCommand cmd = new SingleStatementMatlabCommand(session, cmdInput); Assert.AreEqual(cmdInput, cmd.Input); }
public void TestExecute_InvalidSession() { string cmdInput = "b=a*a"; MLAppClass matlab = MatlabTestInstance.Instance; MatlabSession session = new MatlabSession(matlab); SingleStatementMatlabCommand cmd = new SingleStatementMatlabCommand(session, cmdInput); session.Valid = false; cmd.Execute(); }
public void TestExecute_ValidConditions() { string cmdInput = "b=a*a"; MLAppClass matlab = MatlabTestInstance.Instance; MatlabSession session = new MatlabSession(matlab); SingleStatementMatlabCommand cmd = new SingleStatementMatlabCommand(session, cmdInput); cmd.Execute(); // So long as Matlab tried to run something this should be regarded // as a success. It's up the client to make sure they called everything // correctly. Assert.IsFalse(string.IsNullOrEmpty(cmd.Output)); }
public void TestConstructor_NullCommand() { MLAppClass matlab = MatlabTestInstance.Instance; MatlabSession session = new MatlabSession(matlab); SingleStatementMatlabCommand cmd = new SingleStatementMatlabCommand(session, null); }
public void TestConstructor_NullSession() { SingleStatementMatlabCommand cmd = new SingleStatementMatlabCommand(null, "b=a*a"); }