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");
        }
        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();
        }
        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");
        }
        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();
        }