Sha256: 28107f28e761b1868aeb221e359d3f4dc14d9eb3f0bea4a96311f77d0d5acfa7
Contents?: true
Size: 846 Bytes
Versions: 50
Compression:
Stored size: 846 Bytes
Contents
using NUnit.Framework; [TestFixture] public class LuhnTest { [TestCase("1", ExpectedResult = false)] // single digit strings can not be valid [TestCase("0", ExpectedResult = false, Ignore = "Remove to run test case")] // a single zero is invalid [TestCase("046 454 286", ExpectedResult = true, Ignore = "Remove to run test case")] // valid Canadian SIN [TestCase("046 454 287", ExpectedResult = false, Ignore = "Remove to run test case")] // invalid Canadian SIN [TestCase("8273 1232 7352 0569", ExpectedResult = false, Ignore = "Remove to run test case")] // invalid credit card [TestCase("827a 1232 7352 0569", ExpectedResult = false, Ignore = "Remove to run test case")] // strings that contain non-digits are not valid public bool ValidateChecksum(string number) { return Luhn.IsValid(number); } }
Version data entries
50 entries across 50 versions & 1 rubygems