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); }
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(); }