How would I write the [TestCleanup()] method for these [TestMethod()] s.
我有以下11点:
当他们单独经营时,如果不能同时办理第一次通行证
[TestMethod()]
public void SplitTdsNameTest_SimpleValidName2()
{
string tdsName = "Mr Daniel George Trunley";
MemberName expected = new MemberName("Mr", "Daniel George", "Trunley");
MemberName actual;
actual = TdsTransformer.SplitTdsName(tdsName);
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void SplitTdsNameTest_SimpleValidName3()
{
string tdsName = "Daniel George Trunley";
MemberName expected = new MemberName("", "", "Daniel George Trunley");
MemberName actual;
actual = TdsTransformer.SplitTdsName(tdsName);
Assert.AreEqual(expected, actual);
}
MemberName:
public struct MemberName
{
public string Title;
public string FirstNames;
public string LastNames;
public MemberName(string title, string firstNames, string lastNames)
{
Title = title;
FirstNames = firstNames;
LastNames = lastNames;
}
}
辅助器:
public MemberName SplitTdsName(string tdsName)
{
return NameSplitter.Splitter(tdsName);
}
排放者:
public static MemberName Splitter(string fullName)
{
nameInFull = fullName;
SetAllowedTitles();
SplitNamesAndRemovePeriods();
SetTitles();
MemberName splitName = new MemberName(titles, firstNames, lastNames);
return splitName;
}