Ejemplo n.º 1
0
        //[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));
            
        }
Ejemplo n.º 2
0
        public void TestCreateRaw(){
            RawConnector rc = new RawConnector();
            Assert.IsNotNull(rc);
            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;

            Console.WriteLine(info.Date.ToString("yyyy-MM-dd HH:mm:ss"));
            Console.WriteLine(rc.Add(info));
            Assert.IsTrue(rc.History().Count > 0);
            rc.History().RemoveAt(0);
        }
Ejemplo n.º 3
0
 public          String[] Other; // Additional info, not implemented in the database YET.
 /// <summary>
 /// Check if SysInfo is valid
 /// </summary>
 /// <param name="info">Structure to check.</param>
 /// <returns></returns>
 public static bool CheckInfo(SysInfo info)
 {
     return((info.Environment != null || info.Environment.Equals("")) && info.Date != null && info.PercentageCPU != null && info.PercentageRAM != null);
 }
Ejemplo n.º 4
0
 public bool Add(SysInfo info){
     return connector != null ? connector.Add(info) : false;
 }
Ejemplo n.º 5
0
 public String[] Other; // Additional info, not implemented in the database YET.
 /// <summary>
 /// Check if SysInfo is valid
 /// </summary>
 /// <param name="info">Structure to check.</param>
 /// <returns></returns>
 public static bool CheckInfo(SysInfo info) {
     return (info.Environment != null || info.Environment.Equals("")) && info.Date != null && info.PercentageCPU != null && info.PercentageRAM != null;
 }