示例#1
0
        /// <summary>
        /// Get the Chinese zodiac sign for the supplied date.
        /// </summary>
        /// <param name="requestedDateTime">The date you want to query.</param>
        /// <returns>Returns a Chinese zodiac sign object.</returns>
        public static ChineseZodiacModel GetZodiacSignForDate(DateTime requestedDateTime)
        {
            ChineseZodiacSigns chineseZodiacSign = ChineseZodiacHelper.ConvertYearToChineseZodiacSign(requestedDateTime.Year);

            ChineseZodiacHelper.InitializeAndGetAllZodiacSigns().TryGetValue(chineseZodiacSign, out ChineseZodiacModel chineseZodiacModel);
            return(chineseZodiacModel);
        }
示例#2
0
        public void ConvertYearToChineseZodiacSign_Test(int year, ChineseZodiacSigns zodiacSign)
        {
            var symbol = ChineseZodiacHelper.ConvertYearToChineseZodiacSign(year);

            Assert.Equal(zodiacSign, symbol);
        }