{"size": 1993, "ext": "js", "max_stars_repo_path": "src/test/toString.test.js", "max_stars_repo_name": "ottot1/COMP.SE.200-2021-2022-1", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/test/toString.test.js", "max_issues_repo_name": "ottot1/COMP.SE.200-2021-2022-1", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/test/toString.test.js", "max_forks_repo_name": "ottot1/COMP.SE.200-2021-2022-1", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 36.2363636364, "max_line_length": 90, "alphanum_fraction": 0.5579528349}
import chai from "chai"
import toString from "../toString.js"

const expect = chai.expect

describe("Unit tests of toString", () => {

    it("TS001: One parameter is given: a letter", () => {
        expect(toString('a')).to.deep.equal("a")
    });
    it("TS002: One parameter is given: two letters", () => {
        expect(toString('as')).to.deep.equal("as")
    });
    it("TS003: One parameter is given: a number", () => {
        expect(toString(1)).to.deep.equal('1')
    });
    it("TS004: One parameter is given: two numbers", () => {
        expect(toString(12)).to.deep.equal('12')
    });
    it("TS005: One parameter is given: two letters and two numbers", () => {
        expect(toString('aa12')).to.deep.equal('aa12')
    });
    it("TS006: One parameter is given: a symbol", () => {
        expect(toString('@')).to.deep.equal('@')
    });
    it("TS007: One parameter is given: an array: a number, a symbol and a letter", () => {
        expect(toString([1, '@', 'a'])).to.deep.equal('1,@,a')
    });
    it("TS008: One parameter is given: null", () => {
        expect(toString(null)).to.deep.equal('')
    });
    it("TS009: One parameter is given: an empty string", () => {
        expect(toString('')).to.deep.equal('')
    });
    it("TS0010: One parameter is given: undefined", () => {
        expect(toString(undefined)).to.deep.equal(undefined)
    });
    it("TS0011: One parameter is given: 5 letters", () => {
        expect(toString('aaaaa')).to.deep.equal("aaaaa")
    });
    it("TS0012: One parameter is given: 6 letters", () => {
        expect(toString('aaaaaa')).to.deep.equal("aaaaaa")
    });
    it("TS0013: One parameter is given: 10 letters", () => {
        expect(toString('aaaaaaaaaa')).to.deep.equal("aaaaaaaaaa")
    });
    it("TS0014: Parameter is missing", () => {
        expect(toString()).to.deep.equal("")
    });
    it("TS0015: Too many parameters given", () => {
        expect(function() { toString(1,2); }).to.throw(Error);
    });

})
