stripField() public static method

public static stripField ( string value, int fldnum ) : string
value string
fldnum int
return string
Esempio n. 1
0
 public void testStripFieldHyphen()
 {
     Assert.AreEqual("123", SocSecNum.stripField("123-45-6789", 1), "Expected hyphenated ssn to strip area num to 123");
     Assert.AreEqual("45", SocSecNum.stripField("123-45-6789", 2), "Expected hyphenated ssn to strip group num to 45");
     Assert.AreEqual("6789", SocSecNum.stripField("123-45-6789", 3), "Expected hyphenated ssn to strip serial num to 6789");
 }
Esempio n. 2
0
 public void testStripFieldShort()
 {
     Assert.AreEqual("", SocSecNum.stripField("12", 1), "Expected short ssn to strip area number to be blank");
     Assert.AreEqual("", SocSecNum.stripField("1234", 2), "Expected short ssn to strip group number to be blank");
     Assert.AreEqual("", SocSecNum.stripField("12345678", 3), "Expected short ssn to strip serial number to be blank");
 }
Esempio n. 3
0
 public void testStripFieldLong()
 {
     Assert.AreEqual("123", SocSecNum.stripField("1234", 1), "Expected long ssn to strip area number to be 123");
     Assert.AreEqual("45", SocSecNum.stripField("123456", 2), "Expected long ssn to strip group number to be 45");
     Assert.AreEqual("6789", SocSecNum.stripField("1234567890", 3), "Expected long ssn to strip serial number to be 6789");
 }
Esempio n. 4
0
 public void testStripFieldFldnum()
 {
     Assert.AreEqual("", SocSecNum.stripField("123456789", 4), "Expected invalid fldnum of stripField to return blank");
 }