public static BuiltComponents Build(SimpleProcessElement simpleConfig)
        {
            var counterElement = new ProcessElement(simpleConfig);
            var sourceConfig = new ProcessCountingSourceConfiguration(new[] { counterElement });
            var source = ProcessCountingSourceBuilder.Build(sourceConfig);

            return SimpleComponentBuilder.BuildStandardSinkSet(simpleConfig, source);
        }
        public static IEnumerable<ISnapshotProvider> Build(ProcessCountingSourceConfiguration processCountingSourceConfiguration)
        {
            var processCountingSources = new List<ISnapshotProvider>();

            foreach (ProcessElement config in processCountingSourceConfiguration.Processes)
            {
                processCountingSources.Add(new ProcessCountingSource(config));
            }

            return processCountingSources;
        }
        public void CanBuildSourceFromConfiguration()
        {
            var name = "testSource";

            var configs = new[]
                {
                    new ProcessElement("id", name, "exe", "machine")
                };

            var configCollection = new ProcessCountingSourceConfiguration(configs);

            var sources = ProcessCountingSourceBuilder.Build(configCollection);

            Assert.AreEqual(1, sources.Count());
            Assert.AreEqual(name, sources.First().Name);
        }