public void ShouldReturnTheCorrectBiggestFit(int value, int expectedValue) { var calculator = new ValueBiggestFit(new List<int> { 5, 10, 15, 20 }); var result = calculator.GetFit(value); Assert.That(result, Is.EqualTo(expectedValue)); }
public string Generate(int hour, int minute, int second) { var hoursFirstRow = hour; var hoursSecondRow = hour - _hourBiggestFit.GetFit(hour); var minutesFirstRow = minute; var minutesSecondRow = minute - _minuteBiggestFit.GetFit(minute); return(string.Format("{0}\r\n{1}\r\n{2}\r\n{3}\r\n{4}", _secondsRowGenerator.Generate(second), _hoursFirstRowGenerator.Generate(hoursFirstRow), _hoursSecondRowGenerator.Generate(hoursSecondRow), _minutesFirstRowGenerator.Generate(minutesFirstRow), _minutesSecondRowGenerator.Generate(minutesSecondRow))); }