Exemplo n.º 1
0
        public string getHelloMessage()
        {
            string me        = _environmentVariable.getUserName();
            int    hour      = _date.getHour();
            int    dayOfWeek = _date.getDayOfWeek();

            if ((dayOfWeek == 1 ? hour >= this.morningTime : dayOfWeek > 0) &&
                (dayOfWeek == 5 ? hour < this.eveningTime : dayOfWeek < 5))
            {
                if (hour >= morningTime && hour < this.middayTime)
                {
                    return($"Bonjour {me}");
                }
                else if (hour >= this.middayTime && hour < this.eveningTime)
                {
                    return($"Bon après-midi {me}");
                }
                else
                {
                    return($"Bonsoir {me}");
                }
            }
            else
            {
                return($"Bon week-end {me}");
            }
        }