public void GetStatistics_ShowsPercentageUpToTwoDecimalBasedOnTotalCount(int count, int total, double expected) { _counter.Count = count; var statistics = new CounterManager().GeStatistics(_counter, total); Equal(expected, statistics.Percent); }
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); }
public Counter GetStatistics(int totalCount) { Percent = CounterManager.RoundUp(Count * 100.0 / totalCount); return(this); }
public void GetStatistics_IncludesCounterCount() { var statistics = new CounterManager().GetStatistics(new[] { _counter }).First(); Assert.Equal(5, statistics.Count); }
public void GetStatistics_IncludesCounterCount() { var statistics = new CounterManager().GeStatistics(_counter, 5); Equal(5, statistics.Count); }
public void GetStatistics_IncludesCounterName() { var statistics = new CounterManager().GeStatistics(_counter, 5); Equal(CounterName, statistics.Name); }
public void GetStatistics_IncludesCounterName() { var statistics = new CounterManager().GetStatistics(new[] { _counter }).First(); Equal(CounterName, statistics.Name); }