The unit tests I used were:
/// <summary>
/// Test InitCaps
/// </summary>
[Test]
public void TestInitCaps()
{
this.TestInitCapsTest("", "", true);
this.TestInitCapsTest(null, "", true);
this.TestInitCapsTest("A123", "A123", true);
this.TestInitCapsTest("a123", "A123", true);
this.TestInitCapsTest("hello world", "Hello World", true);
}
#region " TestInitCapsTest "
/// <summary>
/// Test FilterUserName
/// </summary>
/// <param name="sIn">Input string</param>
/// <param name="sExpect">Expected output</param>
/// <param name="bExpect">Expected Test result</param>
private void TestInitCapsTest(string sIn, string sExpect, bool bExpect)
{
string sOutput = CommonData.InitCaps(sIn);
if (sExpect != sOutput)
{
Console.WriteLine("sOutput:" + sOutput);
Console.WriteLine("sExpect:" + sExpect);
}
Assert.AreEqual(sExpect, sOutput);
}
#endregion
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.