public void ThenFirstnameIsFirstWordAndSurnameIsSecondWord() { // Arrange var nameSplitter = new NameSplitter(); // Act var nameParts = nameSplitter.GetNamePartsFromName("Bob Smith"); // Assert Assert.AreEqual("Bob", nameParts.FirstName); Assert.AreEqual("Smith", nameParts.Surname); }
public void ThenFirstnameAndSurnameAreBothEmpty() { // Arrange var nameSplitter = new NameSplitter(); // Act var nameParts = nameSplitter.GetNamePartsFromName(""); // Assert Assert.AreEqual("", nameParts.FirstName); Assert.AreEqual("", nameParts.Surname); }
public void ThenFirstnameIsAllWordsExceptLasttWordAndSurnameIsLastWord() { // Arrange var nameSplitter = new NameSplitter(); // Act var nameParts = nameSplitter.GetNamePartsFromName("Bob TheMan Smith"); // Assert Assert.AreEqual("Bob TheMan", nameParts.FirstName); Assert.AreEqual("Smith", nameParts.Surname); }