public void Setup() { mockedInputSource = new Mock<CTLInputSource>(); mockedDomain = new Mock<CTLDomain>(); ctlModel = new CTLModel(mockedInputSource.Object, mockedDomain.Object); // Setup event-related data startedEvent = new InputElement("1", "TEST", InputElement.Type.Event, InputElement.Action.Started); generatedEvent = new CTLEvent("1", "TEST", 0, 0); mockedDomain.Setup(domain => domain.generateEvent(startedEvent)).Returns(generatedEvent); stoppedEvent = new InputElement("1", "TEST", InputElement.Type.Event, InputElement.Action.Stopped); // Setup task-related data startedTask = new InputElement("2", "TEST", InputElement.Type.Task, InputElement.Action.Started); startedTask.secondaryIndentifier = "1"; generatedTask = new CTLTask("2", "TEST"); mockedDomain.Setup(domain => domain.generateTask(startedTask)).Returns(generatedTask); stoppedTask = new InputElement("2", "TEST", InputElement.Type.Task, InputElement.Action.Stopped); // Setup validTasks with which to calculate multitask elements validTask1 = new CTLTask("2", "ARI_IN"); validTask2 = new CTLTask("3", "COMMUNICATIE"); usedDomains = new List<int>(new int[] { (int)InformationDomain.InformationDomainUnknown }); }
/// <summary> /// The constructor method. /// </summary> /// <param name="ctlModel">A instance of the CTLModel class</param> /// <param name="parser">A instance of the XMLParser class</param> public CTLModelUtilityVC(CTLModel ctlModel, XMLParser parser) { this.View = new CTLModelUtilityView(); this.View.CTLModelUtilityViewShownHandler += new CTLModelUtilityView.EventHandler(viewControllerIsShown); this.View.openScenarioFileButtonClickedHandler += new CTLModelUtilityView.EventHandler(openScenarioFileDialog); this.View.clearListButtonClickedHandler += new CTLModelUtilityView.EventHandler(clearList); this.ctlModel = ctlModel; this.parser = parser; this.cachedActiveEvents = new List<CTLEvent>(); this.cachedActiveTasks = new List<CTLTask>(); this.eventsToDisplay = new List<CTLEvent>(); this.activeTasksToDisplay = new List<CTLTask>(); this.historyTasksToDisplay = new List<CTLTask>(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); XMLParser parser = new XMLParser(); PRLDomain prlDomain = new PRLDomain(); CTLModel ctlModel = new CTLModel(parser, prlDomain); FuzzyModel fuzzyModel = new FuzzyModel(); // Main viewcontroller setup var controller = new MainViewController(ctlModel,fuzzyModel); // Cognitive Load setup CTLModelUtilityVC ctlUtilityVC = new CTLModelUtilityVC(ctlModel, parser); controller.clUtilityView = ctlUtilityVC.View; // Emotional State setup FuzzyModelUtilityVC esUtilityVC = new FuzzyModelUtilityVC(fuzzyModel); controller.esUtilityView = esUtilityVC.View; Application.Run(controller.View); }