public static void ClassCleanup()
        {
            var counters = new PmcCreationData();

            counters.Add(typeof(TestCounter2));
            PmcManager.RemovePerformanceCounters(counters);
        }
        public void UsingRemoveWithWrongCounterFails()
        {
            // --- Arrange
            var pmcData = new PmcCreationData();

            pmcData.Add(typeof(TestProcessorTimePmc));

            // --- Act
            var result = PmcManager.RemovePerformanceCounters(pmcData);

            // --- Assert
            result.Errors.ShouldHaveCountOf(1);
        }
        public void RemoveWorksAsExpected()
        {
            // --- Arrange
            var pmcData = new PmcCreationData();

            pmcData.Add(typeof(TestCounter1));
            pmcData.Add(typeof(TestCounter2));
            pmcData.Add(typeof(TestCounter3));
            pmcData.Add(typeof(TestCounter4));
            pmcData.Add(typeof(TestCounter5));
            pmcData.Add(typeof(TestCounter6));

            // --- Act
            var installResults = PmcManager.InstallPerformanceCounters(pmcData);
            var removeResults  = PmcManager.RemovePerformanceCounters(pmcData);

            // --- Assert
            installResults.InstalledCategories.ShouldHaveCountOf(3);
            installResults.Errors.ShouldHaveCountOf(0);
            removeResults.InstalledCategories.ShouldHaveCountOf(3);
            removeResults.Errors.ShouldHaveCountOf(0);
        }
 public void UsingRemoveWithNullDataFails()
 {
     // --- Act
     PmcManager.RemovePerformanceCounters(null);
 }