Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System.Linq;
  2.  
  3. public class Person
  4. {
  5. private string _FirstName = "John";
  6. public string FirstName
  7. {
  8. get { return _FirstName; }
  9. set { _FirstName = value; }
  10. }
  11. private string _LastName = "Doe";
  12. public string LastName
  13. {
  14. get { return _LastName; }
  15. set { _LastName = value; }
  16. }
  17. public string FullName
  18. {
  19. get { return string.Format("{0} {1}", FirstName, LastName); }
  20. }
  21. public string GetLastNameFirst()
  22. {
  23. return string.Format("{0}, {1}", LastName.ToUpper(), FirstName);
  24. }
  25. public string GetTestData(string testName)
  26. {
  27. var dashLength = 25 - testName.Length;
  28. var dashes = string.Concat(Enumerable.Repeat("-", dashLength));
  29. return string.Format("{{{0}}} {1} {2}", testName, dashes, FullName);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement