public void TestNameFormatter_Format_Name_Valid_Name_3_Given() { string name = "First_Name Second_Name Third_Name Surname"; string expectedName = "Surname First_Name Second_Name Third_Name"; string result = NameFormatter.formatName(name); Assert.AreEqual(expectedName, result); }
public void TestNameFormatter_Format_Name_Invalid_Name() { string name = "Invalid_Name"; string expectedName = "Invalid_Name"; string result = NameFormatter.formatName(name); Assert.AreEqual(expectedName, result); }
/** * Format names so that surname will appear at the beginning * * @return File content as an array of strings */ private string[] formatNames(string[] input) { string[] formattedNames = new string[input.Length]; for (int i = NameSorterDefs.ARRAY_BEGIN; i < input.Length; ++i) { //Console.WriteLine("[DEBUG] Input name " + (i + 1) + ": " + input[i]); formattedNames[i] = NameFormatter.formatName(input[i]); } return(formattedNames); }