Exemple #1
0
        /// <summary>
        /// Performing all test of the cognitive intervention asset.
        /// </summary>
        internal void performAllTests()
        {
            log("Start performing Cognitive Intervention Asset tests:");
            CognitiveInterventionDelegate cognitiveInterventionDelegate = (interventionType, interventionInstance) => log("DelegateLogging: " + interventionType + ", " + interventionInstance);

            performTest1();
            performTest2();
            performTest3();
            performTest4();
            performTest5();
            performTest6();
            log("Cognitive Intervention Asset tests ended.");
        }
Exemple #2
0
        public void Initialize()
        {
            testBool = false;
            if (AssetManager.Instance.findAssetsByClass("CognitiveInterventionAsset").Count == 0)
            {
#warning change bridge implementation (in UnitTestCognitiveIntervention/Bridge.cs) for testing (IDataStoragePath and ILog - logging behaviour)
                //Adding the bridge
                AssetManager.Instance.Bridge = new Bridge();

                //creating the asset
                CognitiveInterventionAsset cia = CognitiveInterventionAsset.Instance;

                //setting feedback method
                CognitiveInterventionDelegate cognitiveInterventionDelegate = (interventionType, interventionInstance) => testBool = true;
                cia.setInterventionDelegate(cognitiveInterventionDelegate);
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            AssetManager.Instance.Bridge = new Bridge();

            CognitiveInterventionAsset cia = CognitiveInterventionAsset.Instance;

            //setting feedback method
            CognitiveInterventionDelegate cognitiveInterventionDelegate = (interventionType, interventionInstance) => Console.WriteLine("DelegateLogging: " + interventionType + ", " + interventionInstance);

            cia.setInterventionDelegate(cognitiveInterventionDelegate);

            //start Test
            TestCognitiveInterventionAsset tcia = new TestCognitiveInterventionAsset();

            tcia.performAllTests();



            Console.WriteLine("Press enter to exit...");
            Console.ReadLine();
        }
 /// <summary>
 /// Methode for setting the Method for handling cognitive interventions
 /// </summary>
 /// <param name="del"> Method (signature: void del(string interventionInstance)) performed if an intervention is needed. </param>
 public void setInterventionDelegate(CognitiveInterventionDelegate del)
 {
     Handler.cognitiveInterventionDelegate = del;
 }