Exemplo n.º 1
0
        /// <summary>
        /// Contains basic example usage scenarios.
        /// </summary>
        public static void ShowZodiacBasicExamples()
        {
            var zodiacSign = Zodiac.GetZodiacSignForDate(new DateTime(1966, 2, 12));

            Console.WriteLine($"\nZodiac details for {new DateTime(1966, 2, 12).ToShortDateString()}");
            Console.WriteLine($"Name: {zodiacSign.ZodiacName} English name: {zodiacSign.ZodiacEnglishTranslation} Duration: {zodiacSign.ZodiacDuration}");

            // Another option would be:
            var givenDate         = new DateTime(1995, 8, 26);
            var anotherZodiacSign = givenDate.GetZodiacSign();

            Console.WriteLine($"\nZodiac details for {givenDate.ToShortDateString()}");
            Console.WriteLine($"Name: {anotherZodiacSign.ZodiacName} English name: {anotherZodiacSign.ZodiacEnglishTranslation} Duration: {anotherZodiacSign.ZodiacDuration}");

            var capriconZodiacSign = Zodiac.GetZodiacSign(ZodiacSigns.Capricorn);

            Console.WriteLine($"\nZodiac duration for {ZodiacSigns.Capricorn}");
            Console.WriteLine(capriconZodiacSign.ZodiacDuration);

            var allZodiacSigns = Zodiac.GetAllZodiacSigns();

            Console.WriteLine($"\nGet a list of all zodiac signs");
            foreach (var currentZodiacSign in allZodiacSigns)
            {
                Console.WriteLine($"-\t{currentZodiacSign.ZodiacName}");
            }
        }
Exemplo n.º 2
0
        public void GetZodiacSignForDate_Test(int month, int day, string zodiacSign)
        {
            var symbol = Zodiac.GetZodiacSignForDate(new DateTime(1950, month, day));

            Assert.Equal(zodiacSign, symbol.ZodiacName);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Gets the zodiac sign for the date supplied.
 /// </summary>
 /// <param name="dateTime">The date for which you want the zodiac sign.</param>
 /// <returns>A zodiac sign object.</returns>
 public static ZodiacModel GetZodiacSign(this DateTime dateTime) => Zodiac.GetZodiacSignForDate(dateTime);