コード例 #1
0
        public string convertTime(string aTime)
        {
            _currentTime = Time.Parse(aTime);

            string output = DrawClock();

            return output;
        }
コード例 #2
0
        public void has_berlin_clock_second_light_on_at_23_59_58()
        {
            //arrange
            Time time = new Time(23, 59, 59);

            //act
            var clock = new BerlinClockModel(time);

            //assert
            Assert.IsFalse(clock.OnSecondLight);
        }
コード例 #3
0
        public void has_berlin_clock_4_and_4_minutes_lights_on_at_10_24_59()
        {
            //arrange
            Time time = new Time(10, 24, 59);

            //act
            var clock = new BerlinClockModel(time);

            //assert
            Assert.AreEqual(4, clock.OnMinutesFirstRowLights);
            Assert.AreEqual(7, clock.OffMinutesFirstRowLights);
            Assert.AreEqual(4, clock.OnMinutesSecondRowLights);
            Assert.AreEqual(0, clock.OffMinutesSecondRowLights);
        }
コード例 #4
0
        public void has_berlin_clock_2_and_1_hour_lights_on_at_12_31_59()
        {
            //arrange
            Time time = new Time(12, 31, 59);

            //act
            var clock = new BerlinClockModel(time);

            //assert
            Assert.AreEqual(2, clock.OnHourFirstRowLights);
            Assert.AreEqual(2, clock.OffHourFirstRowLights);
            Assert.AreEqual(2, clock.OnHourSecondRowLights);
            Assert.AreEqual(2, clock.OffHourSecondRowLights);
        }
コード例 #5
0
        public void has_berlin_clock_4_and_3_hour_lights_on_at_23_59_59()
        {
            //arrange
            Time time = new Time(23, 59, 59);

            //act
            var clock = new BerlinClockModel(time);

            //assert
            Assert.AreEqual(4, clock.OnHourFirstRowLights);
            Assert.AreEqual(0, clock.OffHourFirstRowLights);
            Assert.AreEqual(3, clock.OnHourSecondRowLights);
            Assert.AreEqual(1, clock.OffHourSecondRowLights);
        }
コード例 #6
0
 public string ConvertTime(string inputTime)
 {
     var time = new Time(inputTime);
     return GenerateBerlinClockResult(time);
 }
コード例 #7
0
        public BerlinClockModel(Time time)
        {
            _currentTime = time;

            BuildClock();
        }