コード例 #1
0
        public void RecognizesInstanceAndIgnoresSpaces()
        {
            var pattern = @"\ Process ( Idle  ) \ % Processor Time ";
            var sut     = new PerformanceCounterRegEx();

            var result = sut.split(pattern);

            result.Category.ShouldBe("Process");
            result.Counter.ShouldBe("% Processor Time");
            result.Instance.ShouldBe("Idle");
        }
コード例 #2
0
        public void RecognizesEasyPatternsAndIgnoreSpaces()
        {
            var pattern = @"  Objects  \  Semaphores  ";
            var sut     = new PerformanceCounterRegEx();

            var result = sut.split(pattern);

            result.Category.ShouldBe("Objects");
            result.Counter.ShouldBe("Semaphores");
            result.Instance.ShouldBeNullOrEmpty();
        }
コード例 #3
0
        public void RecognizesInstance()
        {
            var pattern = @"\Processor(_Total)\% Processor Time";
            var sut     = new PerformanceCounterRegEx();

            var result = sut.split(pattern);

            result.Category.ShouldBe("Processor");
            result.Counter.ShouldBe("% Processor Time");
            result.Instance.ShouldBe("_Total");
        }
コード例 #4
0
        public void RecognizesEasyPatterns()
        {
            var pattern = @"\Memory\Available Bytes";
            var sut     = new PerformanceCounterRegEx();

            var result = sut.split(pattern);

            result.Category.ShouldBe("Memory");
            result.Counter.ShouldBe("Available Bytes");
            result.Instance.ShouldBeNullOrEmpty();
        }