Ad
  • Custom User Avatar

    I am a bit confused on submitting a solution using Test Driven Development.

    I have used a list of credit card numbers from https://en.wikipedia.org/wiki/Luhn_algorithm, and have validated them with my code and they all pass accordingly.

    Invalid: 79927398710, 79927398711, 79927398712, 79927398714, 79927398715, 79927398716, 79927398717, 79927398718, 79927398719
    Valid: 79927398713

    How can I go about implementing this in TDD form?

    I currently have:
    Test.assertEquals(validatecard("79927398713"), true);
    Test.assertEquals(validatecard("79927398710"), false);