Esempio n. 1
0
        public void AverageLengthIsMeasured()
        {
            var stats = new TextStats();

            stats.Add(new string('*',100));
            stats.Add(new string('*',50));

            Assert.That(stats.AvgWidth, Is.EqualTo(75.0));
        }
Esempio n. 2
0
 private static void ProcessNumberStrings(TextStats stats)
 {
     var values = new[] {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"};
     foreach (var value in values)
     {
         stats.Add(value);
     }
 }
Esempio n. 3
0
        public void MinimumLengthCanBeZero()
        {
            var stats = new TextStats();
            stats.Add(string.Empty);
            ProcessNumberStrings(stats);

            Assert.That(stats.MinWidth, Is.EqualTo(0));
        }