From 613f74ec8688232f92594e6fbe6c30123cebff06 Mon Sep 17 00:00:00 2001 From: Clyde D'Souza Date: Sun, 25 Nov 2018 14:07:00 +1300 Subject: [PATCH] Added more comments to public methods Updated version to 0.0.2. --- Src/Horoscope.TestConsole/Program.cs | 2 +- Src/Horoscope/Horoscope.csproj | 13 ++++++++----- Src/Horoscope/Model/ZodiacModel.cs | 23 +++++++++++++++++++++-- Src/Horoscope/Zodiac.cs | 24 ++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 8 deletions(-) diff --git a/Src/Horoscope.TestConsole/Program.cs b/Src/Horoscope.TestConsole/Program.cs index 5fef0e1..fbfe998 100644 --- a/Src/Horoscope.TestConsole/Program.cs +++ b/Src/Horoscope.TestConsole/Program.cs @@ -11,7 +11,7 @@ static void Main(string[] args) var symbol = Zodiac.GetZodiacSignForDate(new DateTime(1966, 2, 12)); Console.WriteLine(symbol.ZodiacName +" "+ symbol.ZodiacDuration); - symbol = Zodiac.GetZodiacSign(ZodiacSigns.Aquarius); + symbol = Zodiac.GetZodiacSign(ZodiacSigns.Capricorn); Console.WriteLine(symbol.ZodiacDuration); var allSymbols = Zodiac.GetAllZodiacSigns(); diff --git a/Src/Horoscope/Horoscope.csproj b/Src/Horoscope/Horoscope.csproj index 102887f..903b57d 100644 --- a/Src/Horoscope/Horoscope.csproj +++ b/Src/Horoscope/Horoscope.csproj @@ -5,17 +5,20 @@ Clyde D'Souza false Horoscope - 0.0.1 + 0.0.2 https://github.com/ClydeDz/horoscope-nuget/blob/master/LICENSE https://github.com/ClydeDz/horoscope-nuget https://github.com/ClydeDz/horoscope-nuget/wiki - horoscope zodiac zodiac-signs development library + horoscope zodiac development library zodiac-signs A .NET library for Zodiac signs. Get details on each Zodiac sign, pass a date and know which Zodiac sign it falls in or get a list of all Zodiac signs. Currently in beta. (c) 2018 Clyde D'Souza - Includes basic functionality to get Zodiac signs. Beta release. - 0.0.0.1 - 0.0.0.1 + 0.0.2 +Includes basic functionality to get Zodiac signs. +0.0.1 +Beta release. + 0.0.0.2 + 0.0.0.2 https://raw.githubusercontent.com/ClydeDz/horoscope-nuget/master/Icon.png diff --git a/Src/Horoscope/Model/ZodiacModel.cs b/Src/Horoscope/Model/ZodiacModel.cs index 603c134..0f38dae 100644 --- a/Src/Horoscope/Model/ZodiacModel.cs +++ b/Src/Horoscope/Model/ZodiacModel.cs @@ -1,5 +1,8 @@ namespace Horoscope.Model { + /// + /// The Zodiac sign object containing information on each Zodiac sign. + /// public class ZodiacModel { internal ZodiacModel(string name, string english, ZodiacDateModel start, ZodiacDateModel end) @@ -10,12 +13,28 @@ internal ZodiacModel(string name, string english, ZodiacDateModel start, ZodiacD ZodiacEndDate = end; } + /// + /// The Zodiac latin name. + /// Example: Capricorn. + /// public string ZodiacName { get; set; } + + /// + /// The English translation of the Zodiac name. + /// Example: The Goat. + /// public string ZodiacEnglishTranslation { get; set; } + + /// + /// The duration for this Zodiac sign. + /// Example: December 22 to January 19. + /// + public string ZodiacDuration { get { return $"{ToMonth(ZodiacStartDate.Month)} {ZodiacStartDate.Date} to {ToMonth(ZodiacEndDate.Month)} {ZodiacEndDate.Date}"; } } + internal ZodiacDateModel ZodiacStartDate { get; set; } + internal ZodiacDateModel ZodiacEndDate { get; set; } - public string ZodiacDuration { get { return $"{ToMonth(ZodiacStartDate.Month)} {ZodiacStartDate.Date} to {ToMonth(ZodiacEndDate.Month)} {ZodiacEndDate.Date}"; } } - + internal string ToMonth(int month) { switch (month) diff --git a/Src/Horoscope/Zodiac.cs b/Src/Horoscope/Zodiac.cs index e399fbc..a878e35 100644 --- a/Src/Horoscope/Zodiac.cs +++ b/Src/Horoscope/Zodiac.cs @@ -5,6 +5,9 @@ namespace Horoscope { + /// + /// List of all Zodiac signs + /// public enum ZodiacSigns { Pisces, @@ -21,8 +24,16 @@ public enum ZodiacSigns Aries } + /// + /// Contains all methods pertaining to Zodiac signs. + /// public class Zodiac { + /// + /// Gets the Zodiac sign for the date supplied. + /// + /// The date for which you want the Zodiac sign. + /// A Zodiac sign object. public static ZodiacModel GetZodiacSignForDate(DateTime requestedDateTime) { var zodiacSymbol = InitializeAndGetAllZodiacSigns().Values @@ -34,17 +45,30 @@ public static ZodiacModel GetZodiacSignForDate(DateTime requestedDateTime) return zodiacSymbol; } + /// + /// Get details of the Zodiac sign supplied. + /// + /// The Zodiac sign that you want more details about. + /// A Zodiac sign object. public static ZodiacModel GetZodiacSign(ZodiacSigns requestedZodiacSign) { InitializeAndGetAllZodiacSigns().TryGetValue(requestedZodiacSign, out ZodiacModel zodiacSign); return zodiacSign; } + /// + /// Gets all Zodiac signs and details for each sign. + /// + /// List of Zodiac signs each as a Zodiac sign object. public static List GetAllZodiacSigns() { return InitializeAndGetAllZodiacSigns().Values.ToList(); } + /// + /// Loads all Zodiac signs and returns a complete object. + /// + /// Dictionary collection of Zodiac signs. private static Dictionary InitializeAndGetAllZodiacSigns() { Dictionary zodiacSigns = new Dictionary