예제 #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);
        }
예제 #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);
        }
예제 #3
0
 public Counter GetStatistics(int totalCount)
 {
     Percent = CounterManager.RoundUp(Count * 100.0 / totalCount);
     return(this);
 }
예제 #4
0
        public void GetStatistics_IncludesCounterCount()
        {
            var statistics = new CounterManager().GetStatistics(new[] { _counter }).First();

            Assert.Equal(5, statistics.Count);
        }
예제 #5
0
        public void GetStatistics_IncludesCounterCount()
        {
            var statistics = new CounterManager().GeStatistics(_counter, 5);

            Equal(5, statistics.Count);
        }
예제 #6
0
        public void GetStatistics_IncludesCounterName()
        {
            var statistics = new CounterManager().GeStatistics(_counter, 5);

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

            Equal(CounterName, statistics.Name);
        }