コード例 #1
0
        public void WhenInputInCorrectFormatButSecondsBiggerThant59ExpectArgumentException()
        {
            string input = "13:30:60";

            textInputConverter = new TextTimeFormatInputConversionService();
            Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input));
        }
コード例 #2
0
        public void WhenInputInCorrectFormatButHourBiggerThan24ExpectArgumentException()
        {
            string input = "25:11:11";

            textInputConverter = new TextTimeFormatInputConversionService();
            Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input));
        }
コード例 #3
0
        public void WhenInputInIncorrectFormatExpectArgumentException()
        {
            string input = "SD:rr,ewewe";

            textInputConverter = new TextTimeFormatInputConversionService();
            Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input));
        }
コード例 #4
0
        public void WhenInputIsEmptyExpectArgumentException()
        {
            string input = string.Empty;

            textInputConverter = new TextTimeFormatInputConversionService();
            Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input));
        }
コード例 #5
0
        public void WhenInputInCorrectFormatGetTimeSpanRepresentingPassesAsInputTime()
        {
            string input = "13:25:32";

            textInputConverter = new TextTimeFormatInputConversionService();
            TimeSpan result = textInputConverter.Convert(input);

            Assert.AreEqual("13", result.Hours.ToString());
            Assert.AreEqual("25", result.Minutes.ToString());
            Assert.AreEqual("32", result.Seconds.ToString());
        }
コード例 #6
0
 public TimeConverter(ITimeTextInputConverter inputConverterService, IBerlineClockService berlinClockService, IBerlinClockVisualisationService visualisationService)
 {
     this.berlinClockService    = berlinClockService;
     this.visualisationService  = visualisationService;
     this.inputConverterService = inputConverterService;
 }