コード例 #1
0
 public TrackPerformance()
 {
     calculate = new Calculate();
     listInfoCPU = new List<double>();
     listInfoDisk = new List<double>();
     listInfoRAM = new List<double>();
     machineInfo.infoCPU = 0;
     machineInfo.infoDisk = 0;
     machineInfo.infoRAM = 0;
     count = 0;
     counterDisk = new PerformanceCounter("PhysicalDisk", @"% Disk Time", @"_Total");    //sup de 90%
     counterCPU = new PerformanceCounter("Processor", @"% Processor Time", @"_Total");   //85%
     counterRAM = new PerformanceCounter("Memory", "Available MBytes");                  //moins de 50MB
 }
コード例 #2
0
        public void DonnerListeDoubleEtObtenirMoyenne()
        {
            //Assert
            calculate = new Calculate();
            List<double> list = new List<double>();
            list.Add(1);
            list.Add(2);
            double actualAverage = 1.5;
            double expectedAverage = 0.0;

            //Act
            expectedAverage = calculate.calculMoyenne(list);

            //Assert
            Assert.AreEqual(expectedAverage, actualAverage);
        }