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); } }
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(); }