Beispiel #1
0
            public void TheStartMethodWithoutAnyExceptions()
            {
                // This may NOT throw any exceptions!!!
                StatisticsComponentProxy componentProxy = StatisticsComponentProxy.Instance;

                componentProxy.Start();
            }
Beispiel #2
0
            public void IncrementWithCustomStepSize()
            {
                // This may NOT throw any exceptions!!!
                StatisticsComponentProxy componentProxy = StatisticsComponentProxy.Instance;

                componentProxy.Start();

                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.ActiveRuleDefinitions, 10);
                }
                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.CategoryDeclarations, 10);
                }
                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.CriticalMatches, 10);
                }
                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.FatalMatches, 10);
                }
                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.Files, 10);
                }
                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.InfoMatches, 10);
                }
                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.RuleDeclarations, 10);
                }
                for (int i = 0; i < 100; i++)
                {
                    componentProxy.IncrementCounter(CounterIds.WarningMatches, 10);
                }

                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.ActiveRuleDefinitions), 0);
                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.CategoryDeclarations), 0);
                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.CriticalMatches), 0);
                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.FatalMatches), 0);
                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.Files), 0);
                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.InfoMatches), 0);
                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.RuleDeclarations), 0);
                Assert.AreEqual(1000, componentProxy.ReadCounter(CounterIds.WarningMatches), 0);
            }
Beispiel #3
0
            public void IncrementWithCustomStepSizeWithoutProperInitialization()
            {
                StatisticsComponentProxy componentProxy = StatisticsComponentProxy.Instance;

                componentProxy.IncrementCounter(CounterIds.ActiveRuleDefinitions, 10);
            }
Beispiel #4
0
            public void ReadCounterWithoutProperInitialization()
            {
                StatisticsComponentProxy componentProxy = StatisticsComponentProxy.Instance;

                componentProxy.ReadCounter(CounterIds.ActiveRuleDefinitions);
            }
Beispiel #5
0
            public void IncrementWithASingleStepWithoutProperInitialization()
            {
                StatisticsComponentProxy componentProxy = StatisticsComponentProxy.Instance;

                componentProxy.IncrementCounter(CounterIds.ActiveRuleDefinitions);
            }