Ejemplo n.º 1
0
 public void TestAttachController01()
 {
     using (IController controller = OPCDataSelectorControllerFactory.CreateOPCDataSelectorController01())
     {
         baseForm.AttachController(controller);
     }
 }
Ejemplo n.º 2
0
        public void TestBaseForm_FormClosed01()
        {
            using (IController controller = OPCDataSelectorControllerFactory.CreateOPCDataSelectorController01())
            {
                baseForm.AttachListener(controller);
            }


            object sender         = null;
            FormClosedEventArgs e = null;
            Accessor            baseFormAccessor = ReflectionAccessor.Wrap(baseForm);

            baseFormAccessor.Call("BaseForm_FormClosed", sender, e);
        }
Ejemplo n.º 3
0
        public void TestWriteEventLog01()
        {
            using (OPCDataSelectorController oPCDataSelectorController = OPCDataSelectorControllerFactory.CreateOPCDataSelectorController01())
            {
                string   messageContent = "Message testing";
                string   moduleName     = "Module1";
                Accessor oPCDataSelectorControllerAccessor = ReflectionAccessor.Wrap(oPCDataSelectorController);
                //mkdir logs.
                string pathString = System.IO.Path.Combine((string)oPCDataSelectorControllerAccessor.GetField("CONFIGFOLDER"), "logs");
                System.IO.Directory.CreateDirectory(pathString);
                oPCDataSelectorController.WriteEventLog(messageContent, moduleName);

                //delete created folder
                System.IO.Directory.Delete(pathString, true);
                bool directoryExists = System.IO.Directory.Exists(pathString);
            }
        }