CengageRomansTest

by Matthew Vasallo

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.2/require.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.5.2/jasmine.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.5.2/jasmine.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.5.0/jasmine-html.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.5.2/boot.js"></script>

JavaScript

//https://www.selftaughtjs.com/algorithm-sundays-converting-roman-numerals/
//Test Suite
describe("Roman", function () {
    it('should be able to convert numbers 1 through 3 to roman numeral I to III', function () {
        expect(RomanMath.ConvertToRomanNumeral(1)).toBe("I");
        expect(RomanMath.ConvertToRomanNumeral(2)).toBe("II");
        expect(RomanMath.ConvertToRomanNumeral(3)).toBe("III");
    });

    it('should be able to convert number 4 to roman numeral IV', function () {
        expect(RomanMath.ConvertToRomanNumeral(4)).toBe("IV");
    });

    it('should be able to convert number 5 to roman numeral V', function () {
        expect(RomanMath.ConvertToRomanNumeral(5)).toBe("V");
    });

    it('should be able to convert number 6 through 8 to roman numerals', function () {
        expect(RomanMath.ConvertToRomanNumeral(6)).toBe("VI");
        expect(RomanMath.ConvertToRomanNumeral(7)).toBe("VII");
        expect(RomanMath.ConvertToRomanNumeral(8)).toBe("VIII");
    });


    fit('should be able to convert number 9 to roman numeral IX', function () {
        expect(RomanMath.ConvertToRomanNumeral(9)).toBe("IX");
    });

    it('should be able to convert number 10 through 19 to roman numeral', function () {
        expect(RomanMath.ConvertToRomanNumeral(10)).toBe("X");
        expect(RomanMath.ConvertToRomanNumeral(11)).toBe("XI");
        //expect(RomanMath.ConvertToRomanNumeral(19)).toBe("XIX");
    });

    it('should be able to convert number 20 - 99 to roman numerals', function () {
        expect(RomanMath.ConvertToRomanNumeral(20)).toBe("XX");
        expect(RomanMath.ConvertToRomanNumeral(23)).toBe("XXIII");
        expect(RomanMath.ConvertToRomanNumeral(61)).toBe("LXI");
        expect(RomanMath.ConvertToRomanNumeral(74)).toBe("LXXIV");
    });

    it('should be able to convert number 100 to 1000 to roman numeral', function () {
        expect(RomanMath.ConvertToRomanNumeral(100)).toBe("C");
       ...