public void UsTaxIdNumberTest1() { ulong source = 123456789; UsTaxIdNumber usTax = new UsTaxIdNumber(source, k1, k2, k3, k4); Assert.AreEqual("6789", usTax.LastFour); byte[] encry = usTax.Value; UsTaxIdNumber usTax1 = new UsTaxIdNumber(encry, k1); Assert.AreEqual(6789, usTax1.ClearValue); Assert.AreNotEqual(source.ToString("000-00-0000"), usTax1.ToSSN(k1, k2)); Assert.AreEqual(source.ToString("000-00-0000"), usTax1.ToSSN(k1, k2, k3, k4)); Assert.AreEqual("12-3456789", usTax1.ToEIN(k1, k2, k3, k4)); }
public void UsTaxIdNumberTest() { // Set the source. string source = "123-45-678"; Assert.ThrowsException <ArgumentOutOfRangeException>(() => new UsTaxIdNumber(source, k1, k2, k3, k4)); source += "9"; UsTaxIdNumber usTax = new UsTaxIdNumber(source, k1, k2, k3, k4); Assert.AreEqual("6789", usTax.LastFour); byte[] encry = usTax.Value; UsTaxIdNumber usTax1 = new UsTaxIdNumber(encry, k1); Assert.AreEqual(6789, usTax1.ClearValue); Assert.AreNotEqual(source, usTax1.ToSSN(k1, k2)); Assert.AreEqual(source, usTax1.ToSSN(k1, k2, k3, k4)); Assert.AreEqual("12-3456789", usTax1.ToEIN(k1, k2, k3, k4)); }