public void RuleFailures_FailureTB_MultipleTBRefs_1()
        {
            string outputDir     = "RuleFailures_FailureTB_MultipleTBRefs_1";
            string testBenchPath = "/@Test Benches|kind=Testing|relpos=0/@RuleFailures|kind=Testing|relpos=0/@FailureTB_MultipleTBRefs_1|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
        public void Fail_RuleFailures_CyPhy2ModelicaRulesFailure()
        {
            string outputDir     = "RuleFailures_CyPhy2ModelicaRulesFailure";
            string testBenchPath = "/@Test Benches|kind=Testing|relpos=0/@RuleFailures|kind=Testing|relpos=0/@CyPhy2ModelicaRulesFailure|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.False(result, "CyPhy2Modelica_v2 should have failed, but did not.");
        }
        public void TestBenches_MassSpringDamperTest()
        {
            string outputDir     = "Test Benches_MassSpringDamperTest";
            string testBenchPath = "/@Test Benches|kind=Testing|relpos=0/@MassSpringDamperTest|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
Exemple #4
0
        public void TestBenches_RollingWheelDummyPropertiesInTestBench()
        {
            string outputDir     = "TestBenches_RollingWheelDummyPropertiesInTestBench";
            string testBenchPath = "/@TestBenches|kind=Testing|relpos=0/@RollingWheelDummyPropertiesInTestBench|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
Exemple #5
0
        public void TestBenches_RollingWheelBooleanParameterInComponent()
        {
            string outputDir     = "TestBenches_RollingWheelBooleanParameterInComponent";
            string testBenchPath = "/@TestBenches|kind=Testing|relpos=0/@RollingWheelBooleanParameterInComponent|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
        public void tbs_MSD_system_where_inner_system_only_has_dynamic_models()
        {
            string outputDir     = "tbs_MSD_system_where_inner_system_only_has_dynamic_models";
            string testBenchPath = "/@Dynamics|kind=Testing|relpos=0/@tbs|kind=Testing|relpos=0/@MSD_system_where_inner_system_only_has_dynamic_models|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
        public void tbs_MSD_extra_mass_with_unconnected_modelica_model()
        {
            string outputDir     = "tbs_MSD_extra_mass_with_unconnected_modelica_model";
            string testBenchPath = "/@Dynamics|kind=Testing|relpos=0/@tbs|kind=Testing|relpos=0/@MSD_extra_mass_with_unconnected_modelica_model|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
        public void Dynamics_MSD()
        {
            string outputDir     = "Dynamics_MSD";
            string testBenchPath = "/@Dynamics|kind=Testing|relpos=0/@MSD|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
        public void tbs_MSD_passing_value_nested_systems()
        {
            string outputDir     = "tbs_MSD_passing_value_nested_systems";
            string testBenchPath = "/@Dynamics|kind=Testing|relpos=0/@tbs|kind=Testing|relpos=0/@MSD_passing_value_nested_systems|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
        public void Fail_Testing_RICircuit_CARI2()
        {
            string outputDir     = "Testing_RICircuit_CARI2";
            string testBenchPath = "/@Testing|kind=Testing|relpos=0/@RICircuit_CARI2|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.False(result, "CyPhy2Modelica_v2 should have failed, but did not.");
        }
        public void Dynamics_FullSpeedForward_cfg1()
        {
            string outputDir     = "Dynamics_FullSpeedForward_cfg1";
            string testBenchPath = "/@TestBenches|kind=Testing|relpos=0/@Dynamics|kind=Testing|relpos=0/@FullSpeedForward_cfg1|kind=TestBench|relpos=0";

            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            bool result = false;

            result = CyPhy2ModelicaRunner.Run(outputDir, mgaFile, testBenchPath);

            Assert.True(result, "CyPhy2Modelica_v2 failed.");
        }
        public void MSD_dymola_cfg871()
        {
            Assert.True(File.Exists(mgaFile), "Failed to generate the mga.");
            CyPhyGUIs.IInterpreterResult result = null;
            try
            {
                result = CyPhy2ModelicaRunner.Run("MSD_dymola_cfg871", mgaFile,
                                                  "/@TestBenches|kind=Testing|relpos=0/@PCC_NaN|kind=Testing|relpos=0/@MSD_dymola_cfg871|kind=TestBench|relpos=0");
            }
            catch (META.InterpreterException ex)
            {
                Console.WriteLine(ex.Message);
                Assert.NotNull(result);
            }

            Assert.NotNull(result);
            Assert.True(result.Success, "Interpreter return with result.Success as false!");
            var runCommand = result.RunCommand.Split(new char[] { ' ' }).FirstOrDefault();

            Assert.True(File.Exists(Path.Combine(Path.GetDirectoryName(mgaFile), "MSD_dymola_cfg871", runCommand)),
                        string.Format("RunCommand file : {0}, does not exist.", runCommand));
        }