Ejemplo n.º 1
0
 //both input strings, actual and expected, has different UPC-A code and different check digit which are equal 7 and 0
 public void CkeckDigitByZeroPath_ActualNotExpected_ReturnsUPCcodeWithCkeckDigit()
 {
     Assert.AreNotEqual("111111111117", UPC_CheckDigit.Calculate_check_digit("00000000000"));
 }
Ejemplo n.º 2
0
 //both input strings, actual and expected, has different UPC-A code and different check digit which are equal 4 and 7
 public void CkeckDigitByNotZeroPath_ActualNotExpected_ReturnsUPCcodeWithCkeckDigit()
 {
     Assert.AreNotEqual("712345678904", UPC_CheckDigit.Calculate_check_digit("11111111111"));
 }
Ejemplo n.º 3
0
 //both input strings, actual and expected, has different UPC-A code but same check digit which is equal 0
 public void CkeckDigitByZeroPath_NotExpectedUPCcode_ReturnsUPCcodeWithCkeckDigit()
 {
     Assert.AreNotEqual("919959191090", UPC_CheckDigit.Calculate_check_digit("00000000000"));
 }
Ejemplo n.º 4
0
 public void CkeckDigitOnInvalidArgument_InvalidFormatOfUPCcode_ThrowsException()
 {
     Assert.Throws <FormatException>(() => UPC_CheckDigit.Calculate_check_digit("7l234567890"));
 }
Ejemplo n.º 5
0
 public void CkeckDigitOnInvalidArgument_UPCcodeIsToShort_ThrowsException()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => UPC_CheckDigit.Calculate_check_digit("7234567890"));
 }
Ejemplo n.º 6
0
 public void CkeckDigitOnInvalidArgument_UPCcodeIsNull_ThrowsException()
 {
     Assert.Throws <ArgumentNullException>(() => UPC_CheckDigit.Calculate_check_digit(null));
 }
Ejemplo n.º 7
0
 public void CkeckDigitByZeroPath__UPCcode_ReturnsUPCcodeWithCkeckDigit()
 {
     Assert.AreEqual("000000000000", UPC_CheckDigit.Calculate_check_digit("00000000000"));
 }
Ejemplo n.º 8
0
 public void CkeckDigitByNotZeroPath_UPCcode_ReturnsUPCcodeWithCkeckDigit(String exp_upc_code_with_check_digit, String upc_code)
 {
     Assert.AreEqual(exp_upc_code_with_check_digit, UPC_CheckDigit.Calculate_check_digit(upc_code));
 }