Labor – JUnit, Factory-Methoden

1. Klasse 'Rectangle'

Erläuterungen dazu siehe Unit-Testing mit BlueJ

Erstelle eine Klasse Rectangle mit Parameter-Prüfungen (>0, length >= width) und schreibe Unit-Tests für Setters/Getters, Constructor/Getters, calcDiagonal(..), calcPerimeter(..), calcArea(..), ofDiagLen(..)/Getters, ofAreaWidth(..)/Getters

Perimeter DE: Umfang

Rectanglelength: floatwidth: floatConstructor(length: float, width: float)ofDiagLen(diagonal: float, length: float): RectangleofAreaWidth(area: float, width: float)setLength(length: float)setWidth(width: float)calcDiagonal(): floatcalcPerimeter(): floatcalcArea(): floatprintInfo()getLength(): floatgetWidth(): float