示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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();
        }
示例#4
0
        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));
        }
示例#5
0
 public void TestConstructor_NullCommand()
 {
     MLAppClass    matlab             = MatlabTestInstance.Instance;
     MatlabSession session            = new MatlabSession(matlab);
     SingleStatementMatlabCommand cmd = new SingleStatementMatlabCommand(session, null);
 }
示例#6
0
 public void TestConstructor_NullSession()
 {
     SingleStatementMatlabCommand cmd = new SingleStatementMatlabCommand(null, "b=a*a");
 }