//[ExpectedException(typeof(RawConnException), "Aucune Erreur reçue", AllowDerivedTypes = true)]
        public void TestAdd(){
            SecuredConnector sc = new SecuredConnector();
            Assert.IsNotNull(sc);

            SysInfo info = new SysInfo();
            info.Environment = Environment.OSVersion.VersionString;
            var data = RedX.Diagnostics.Client.SystemDiagnostics.SystemInfo();

            info.PercentageCPU = data[0];
            info.PercentageRAM = data[1];
            info.Date = DateTime.Now;

            Assert.IsFalse(sc.Add(info));
            
        }
示例#2
0
        public RedXInfoService(){
            InitializeComponent();
            
            try {
                wLog = new LogWriter(null, null);
                sc = new SecuredConnector();
            } catch(RawInitException e){
                if (e.Gravity <= ExceptionGravity.HIGH){
                    wLog.WriteIntoFile("Une erreur indiquant une erreur grave est capturée, arrêt de l'application " +  e.Message);
                    this.Stop();
                }
            } catch (Exception e){
                this.Stop();
            }

            ThreadPool.SetMaxThreads(2, 2);
            ThreadPool.QueueUserWorkItem(delegate { lastData.Environment = Const.GetOS(); });
        }
 //[ExpectedException(typeof(RawInitException),"Aucune Erreur reçue", AllowDerivedTypes=true)]
 public void TestCreateSecure(){
     SecuredConnector sc = new SecuredConnector();
     Assert.IsNotNull(sc);
 }