Esempio n. 1
0
 public void TestNameGetFullNameWithPlusSign()
 {
     Name n = new Name("first+last");
     Assert.AreNotEqual(null, n, "Default constructor returned null object.");
     n.PutComponent("first", "Cory");
     n.PutComponent("last", "Owens");
     string full = n.GetFullName();
     Assert.AreEqual("CoryOwens", full, "Returned full name does not match expected. Expected: CoryOwens. Returned: " + full);
 }
Esempio n. 2
0
 public void TestNameGetFullNameWithDashInName()
 {
     Name n = new Name("first last");
     Assert.AreNotEqual(null, n, "Default constructor returned null object.");
     n.PutComponent("first", "Jean-Luc");
     n.PutComponent("last", "Picard");
     string full = n.GetFullName();
     Assert.AreEqual("Jean-Luc Picard", full, "Returned full name does not match expected. Expected: Jean-Luc Picard. Returned: " + full);
 }
Esempio n. 3
0
 public void TestNameGetFullNameWithApostropheInName()
 {
     Name n = new Name("first last");
     Assert.AreNotEqual(null, n, "Default constructor returned null object.");
     n.PutComponent("first", "Austin");
     n.PutComponent("last", "O'Neal");
     string full = n.GetFullName();
     Assert.AreEqual("Austin O'Neal", full, "Returned full name does not match expected. Expected: Austin O'Neal. Returned: " + full);
 }
Esempio n. 4
0
 public void TestNameGetFullNameWithDash()
 {
     Name n = new Name("first maiden-last");
     Assert.AreNotEqual(null, n, "Default constructor returned null object.");
     n.PutComponent("first", "Jane");
     n.PutComponent("maiden", "Doe");
     n.PutComponent("last", "Smith");
     string full = n.GetFullName();
     Assert.AreEqual("Jane Doe-Smith", full, "Returned full name does not match expected. Expected: Jane Doe-Smith. Returned: " + full);
 }
Esempio n. 5
0
 public void TestNameSuhail()
 {
     Name n = new Name("personal al-title ibn'father");
     Assert.AreNotEqual(null, n, "Default constructor returned null object.");
     n.PutComponent("personal", "Suhail");
     n.PutComponent("al", "al");
     n.PutComponent("title", "Rashid");
     n.PutComponent("ibn", "ibn");
     n.PutComponent("father", "Sabiq");
     string full = n.GetFullName();
     Assert.AreEqual("Suhail al-Rashid ibn'Sabiq", full, "Returned full name does not match expected. Expected: Suhail al-Rashid ibn'Sabiq. Returned: " + full);
 }