| | |
| | | |
| | | test("Lecture: constructor:", t=>{ |
| | | const name = "Informatic", ects = 5, sws = 3; |
| | | let informatic = new Lecture(name, ects, sws, ); |
| | | const informatic = new Lecture(name, ects, sws, ); |
| | | t.is(informatic.name, name); |
| | | t.is(informatic.sws, sws); |
| | | t.is(informatic.ects, ects); |
| | |
| | | |
| | | |
| | | test("Lecture: get Effort", t =>{ |
| | | let js = new Lecture("JavaScript", 5, 4); |
| | | let effort = js.effortPerWeek(15); |
| | | const js = new Lecture("JavaScript", 5, 4); |
| | | const effort = js.effortPerWeek(15); |
| | | t.is(effort, 7); |
| | | let lectures = [ |
| | | const lectures = [ |
| | | new Lecture("Informatik 1", 5, 4), |
| | | new Lecture("Programmierung 1", 8, 5), |
| | | new Lecture("JavaScript", 5, 4) |
| | | ]; |
| | | let effortOfWeek = lectures.reduce( (acc, l) => l.effortPerWeek(15) + acc, 0); |
| | | const effortOfWeek = lectures.reduce( (acc, l) => l.effortPerWeek(15) + acc, 0); |
| | | const expected = 26.25; |
| | | const tolerance = 0.01; |
| | | t.truthy( Math.abs(effortOfWeek - expected) < tolerance ); |
| | |
| | | const name = "JavaScript", |
| | | ects = 5, |
| | | sws = 4; |
| | | let js = new Lecture(name, ects, sws); |
| | | const js = new Lecture(name, ects, sws); |
| | | t.is(js.name, name); |
| | | t.is(js.ects, ects); |
| | | t.is(js.sws, sws); |
| | |
| | | const name = "JavaScript", |
| | | ects = 5, |
| | | sws = 4; |
| | | let js = new Lecture("name", 1, 3); |
| | | const js = new Lecture("name", 1, 3); |
| | | |
| | | js.ects = ects; |
| | | js.sws = sws; |