@@ -0,0 +1,2249 @@
+package org.wahlzeit.model;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0A/*%0A * Copyright (c) 2006-2009 by Dirk Riehle, http://dirkriehle.com%0A *%0A * This file is part of the Wahlzeit photo rating application.%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as%0A * published by the Free Software Foundation, either version 3 of the%0A * License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public%0A * License along with this program. If not, see%0A * %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0Apublic class MotorcycleManagerTest %7B%0A%0A    MotorcycleManager motorcycleManager;%0A%0A    private final String BRAND = %22Yamaha%22;%0A    private final String MODEL = %22XJ 650%22;%0A    private final int BUILD_YEAR = 1982;%0A    private final String NAME = %22Yamaha XJ 650 (1982)%22;%0A    @Before%0A    public void setUp() throws Exception %7B%0A        motorcycleManager = MotorcycleManager.getInstance();%0A        assertNotNull(motorcycleManager);%0A    %7D%0A%0A    @Test%0A    public void createMotorcycle() %7B%0A        Motorcycle test = motorcycleManager.createMotorcycle( MotorcycleType.Type.SCRAMBLER, BRAND, MODEL, BUILD_YEAR);%0A        assertEquals(test.getBrand(), BRAND);%0A        assertEquals(test.getBuildYear(), BUILD_YEAR);%0A        assertEquals(test.getModel(), MODEL);%0A%0A        Motorcycle test2 = motorcycleManager.getMotorcycle(NAME);%0A        assertEquals(test,test2);%0A    %7D%0A%0A    @Test%0A    public void addGetMotorcycleType()%7B%0A        motorcycleManager.addMotorcycleType(MotorcycleType.Type.ENDURO);%0A%0A        MotorcycleType motorcycleTypeEnduro = motorcycleManager.getMotorcycleType(MotorcycleType.Type.ENDURO);%0A        assertNotNull(motorcycleTypeEnduro);%0A%0A        MotorcycleType motorcycleTypeScrambler = motorcycleManager.getMotorcycleType(MotorcycleType.Type.SCRAMBLER);%0A        assertNull(motorcycleTypeScrambler);%0A    %7D%0A%0A%7D

add motorcyclemanagertest