public void When_given_an_afternoon_time_it_should_be_translated_to_non_24_hour_time()
        {
            var hour = 16;
            var minute = 20;
            var second = 31;

            var dateTime = new DateTime(2009, 10, 2, hour, minute, second);
            var time = new Time(dateTime);
            var translationRules = new TranslationRules();

            var languageNeutralTranslation = translationRules.Conceptualize(time);

            Assert.AreEqual(4, languageNeutralTranslation.Hours);
            Assert.AreEqual(minute, languageNeutralTranslation.Minutes);
            Assert.AreEqual(second, languageNeutralTranslation.Seconds);
        }
예제 #2
0
        public Sound[] HowDoISay(Time.Time time)
        {
            var translationRules = new TranslationRules();
            var conceptualizedTime = translationRules.Conceptualize(time);
            var soundRepo = new SoundRepository();

            var hours = conceptualizedTime.Hours;
            var minutes = conceptualizedTime.Minutes;
            var seconds = conceptualizedTime.Seconds;

            var hourSound = soundRepo.Get(hours);
            var hourWordSound = soundRepo.Get("hours");
            var minutesSound = soundRepo.Get(minutes);
            var secondsSound = soundRepo.Get(seconds);

            return new []
                    {
                        hourSound,
                        hourWordSound,
                        minutesSound
                    };
        }