Beispiel #1
0
 public static bool Validate(People people)
 {
     if (string.IsNullOrWhiteSpace(people.FirstName))
     {
         StandardMessages.DisplayValidationError("First Name");
         return(false);
     }
     if (string.IsNullOrWhiteSpace(people.LastName))
     {
         StandardMessages.DisplayValidationError("Last Name");
         return(false);
     }
     return(true);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            //code for guessing number game
            var numberGuess = new NumberGuess();

            numberGuess.InformUser();
            numberGuess.DiscoverNumber();
            numberGuess.Announceresult();

            //SRP implementations

            StandardMessages.WelcomeMessage();
            var  user        = PersondataCapture.Capture();
            bool IsUserValid = PersonValidator.Validate(user);

            if (IsUserValid == false)
            {
                StandardMessages.EndApplication();
                return;
            }
            AccountGenerator.CreateAccount(user);
            StandardMessages.EndApplication();
        }