public string convertTime(string aTime)
        {
            var time = Time.Parse(aTime);

            var clock = BerlinClock.Classes.BerlinClock.FromTime(time);

            return(clock.TimeStr);
        }
        public void ThenTheProgrammerShouldGetAParseErrorInThePortion(string parameterName)
        {
            try
            {
                Time.Parse(_time);
            }
            catch (ArgumentException e)
            {
                Assert.AreEqual(parameterName, e.ParamName);
                return;
            }

            Assert.Inconclusive();
        }
Beispiel #3
0
        /// <inheritdoc/>
        public string ConvertTime(string aTime)
        {
            if (String.IsNullOrEmpty(aTime))
            {
                throw new ArgumentNullException("aTime");
            }

            Time time = Time.Parse(aTime);

            IClock <Time> clock = new BerlinClock();

            clock.Set(time);

            return(clock.ToString());
        }
 public Time TimeTransform(string time)
 {
     return(Time.Parse(time));
 }
Beispiel #5
0
 public void Parse_Must_Throw_ArgumentNullException_When_Argument_Is_Null()
 {
     Assert.Throws <ArgumentNullException>(() => Time.Parse(null));
 }
Beispiel #6
0
 public void Parse_Must_Throw_ArgumentException_When_Argument_Is_Not_Valid(string time)
 {
     Assert.Throws <ArgumentException>(() => Time.Parse(time));
 }
Beispiel #7
0
 public void Parse_Must_Return_Expected(string time, Time expected)
 {
     Assert.AreEqual(expected, Time.Parse(time));
 }
 public string convertTime(string aTime)
 {
     return(string.Join(Environment.NewLine,
                        Clock.Zip(GetLampsInRows(Time.Parse(aTime)), (row, lamps) => FormatLampString(row, lamps))));
 }
 public void ThenTheProgrammerShouldGetAParsedInstanceThatLooksLike(string expectedTimeRepresentation)
 {
     Assert.AreEqual(expectedTimeRepresentation, Time.Parse(_time).ToString());
 }