package hws.hw4;

public class WhiteBoxTests {

    public static void main(String[] args) {
        FencingEvent event;
        Bout bout;

        // Coverage of the FencingEvent enum
        event = FencingEvent.FOIL;
        Test.forEqual(500, event.getMaximumWeight(), "getMaximumWeight()");
        Test.forTrue(event.isScoringTouch(BladePart.TIP, BodyPart.TORSO), "isScoringTouch()");
        Test.forFalse(event.isScoringTouch(BladePart.EDGE, BodyPart.TORSO), "isScoringTouch()");
        Test.forFalse(event.isScoringTouch(BladePart.EDGE, BodyPart.HANDS), "isScoringTouch()");
        event = FencingEvent.SABRE;
        Test.forTrue(event.isScoringTouch(BladePart.EDGE, BodyPart.TORSO), "isScoringTouch()");

        // Coverage of the Bout class
        bout = new Bout(FencingEvent.FOIL, "Bayer", "Kellner");
        Test.forEqual(FencingEvent.FOIL.toString(), bout.getEvent().toString(), "getEvent()");
        Test.forEqual("Bayer", bout.getLeftFencer(), "getLeftFencer()");
        Test.forEqual("Kellner", bout.getRightFencer(), "getRightFencer()");
        Test.forEqual("Bayer 0, Kellner 0", bout.toString(), "toString()");
        bout.increaseLeftScore();
        bout.increaseRightScore();

        System.out.println(Test.getSummary());
    }

}
