Ejemplo n.º 1
0
        public void GetStatistics_ShowsPercentageUpToTwoDecimalBasedOnTotalCount(int count, int total, double expected)
        {
            _counter.Count = count;
            var statistics = new CounterManager().GeStatistics(_counter, total);

            Equal(expected, statistics.Percent);
        }
Ejemplo n.º 2
0
        public void GetStatistics_ShowPercentageBasedOnDecimalBasedOnTotalCount(int count, int total, double expected)
        {
            _counter.Count = count;
            var counter = new Counter {
                Count = total - count
            };
            var statistics = new CounterManager().GetStatistics(new[] { _counter, counter }).First();;

            Assert.Equal(expected, statistics.Percent);
        }
Ejemplo n.º 3
0
 public Counter GetStatistics(int totalCount)
 {
     Percent = CounterManager.RoundUp(Count * 100.0 / totalCount);
     return(this);
 }
Ejemplo n.º 4
0
        public void GetStatistics_IncludesCounterCount()
        {
            var statistics = new CounterManager().GetStatistics(new[] { _counter }).First();

            Assert.Equal(5, statistics.Count);
        }
Ejemplo n.º 5
0
        public void GetStatistics_IncludesCounterCount()
        {
            var statistics = new CounterManager().GeStatistics(_counter, 5);

            Equal(5, statistics.Count);
        }
Ejemplo n.º 6
0
        public void GetStatistics_IncludesCounterName()
        {
            var statistics = new CounterManager().GeStatistics(_counter, 5);

            Equal(CounterName, statistics.Name);
        }
Ejemplo n.º 7
0
        public void GetStatistics_IncludesCounterName()
        {
            var statistics = new CounterManager().GetStatistics(new[] { _counter }).First();

            Equal(CounterName, statistics.Name);
        }