Exemple #1
0
 /// <summary>
 /// Gets all zodiac signs that are associated with the zodiac element supplied.
 /// This is a fixed element-to-zodiac-sign association.
 /// </summary>
 /// <param name="chineseZodiacElements">The zodiac element that you want to query.</param>
 /// <returns>Returns a list of Chinese zodiac signs that are associated with the supplied zodiac element.</returns>
 public static List <ChineseZodiacModel> GetAllZodiacSignsForAnElement(ChineseZodiacElements chineseZodiacElements)
 {
     return(ChineseZodiacHelper.InitializeAndGetAllZodiacSigns().Values
            .Where(z => z.ZodiacFixedElement == chineseZodiacElements)
            .Select(c => c)
            .ToList());
 }
Exemple #2
0
 /// <summary>
 /// Gets all zodiac signs that are associated with either Yin or Yang.
 /// This is a fixed yinyang-to-zodiac-sign association.
 /// </summary>
 /// <param name="yinOrYang">Supply either Yin or Yang.</param>
 /// <returns>Returns a list of Chinese zodiac signs that match the YinYang filter.</returns>
 public static List <ChineseZodiacModel> GetAllZodiacSignsForYinYang(YinYang yinOrYang)
 {
     return(ChineseZodiacHelper.InitializeAndGetAllZodiacSigns().Values
            .Where(z => z.ZodiacYinYang == yinOrYang)
            .Select(c => c)
            .ToList());
 }
Exemple #3
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);
        }
Exemple #4
0
 /// <summary>
 /// Gets all zodiac signs and details for each sign.
 /// </summary>
 /// <returns>List of zodiac signs each as a Zodiac sign object.</returns>
 public static List <ChineseZodiacModel> GetAllZodiacSigns()
 {
     return(ChineseZodiacHelper.InitializeAndGetAllZodiacSigns().Values.ToList());
 }
Exemple #5
0
 /// <summary>
 /// Get details of the zodiac sign supplied.
 /// </summary>
 /// <param name="requestedZodiacSign">The zodiac sign that you want more details about.</param>
 /// <returns>A Chinese zodiac sign object.</returns>
 public static ChineseZodiacModel GetZodiacSign(ChineseZodiacSigns requestedZodiacSign)
 {
     ChineseZodiacHelper.InitializeAndGetAllZodiacSigns().TryGetValue(requestedZodiacSign, out ChineseZodiacModel zodiacSign);
     return(zodiacSign);
 }
Exemple #6
0
 public void InitializeAndGetAllZodiacSigns_ZodiacEnglishTranslation_Test()
 {
     ChineseZodiacHelper.InitializeAndGetAllZodiacSigns().TryGetValue(ChineseZodiacSigns.Goat, out Model.ChineseZodiacModel zodiacModel);
     Assert.Equal(ChineseZodiacSigns.Goat.ToString(), zodiacModel.ZodiacEnglishTranslation);
 }
Exemple #7
0
        public void InitializeAndGetAllZodiacSigns_Count_Test()
        {
            var symbol = ChineseZodiacHelper.InitializeAndGetAllZodiacSigns();

            Assert.Equal(12, symbol.Count);
        }