Example #1
0
        public SimulinkConnectorFixture()
        {
            Connector = null;
            Logger    = new SmartLogger();

            Logger.AddWriter(new ConsoleTextWriter());

            try
            {
                Logger.WriteInfo("Attempting to launch MATLAB COM automation server");
                Connector = new SimulinkModelImport.SimulinkConnector(Logger);
            }
            catch (Exception e)
            {
                Logger.WriteWarning("MATLAB/Simulink not found");
            }
        }
Example #2
0
        public void UnitsDoNotMatch()
        {
            string outputDir         = "results/" + GetCurrentMethod();
            string petExperimentPath = "/@Testing/@ParametricExploration/@UnitsDoNotMatch";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            var logger       = new SmartLogger();
            var stringWriter = new StringWriter();

            logger.AddWriter(stringWriter);
            var result = DynamicsTeamTest.CyPhyPETRunner.RunReturnFull(outputDir, mgaFile, petExperimentPath, logger);

            stringWriter.Flush();
            var loggerContents = stringWriter.GetStringBuilder().ToString();

            Assert.Contains("must match unit for ", loggerContents);
            Assert.False(result.Item2.Success, "CyPhyPET should have failed.");
        }