private static void InvalidName() { try { var person = SmartPerson.Create(null, 30); } catch (ArgumentNullException ex) { WriteLine($"{ex.Message}"); } }
private static void InvalidAge() { try { var person = SmartPerson.Create("George", -1); } catch (ArgumentOutOfRangeException ex) { WriteLine($"{ex.Message}"); } }
private static void HappyPath() { var person = SmartPerson.Create("George", 30); WriteLine($"Valid person data so all goes well and we can print: {person}"); }