@@ -0,0 +1,2418 @@
+/*%0A * Copyright 2017, TeamDev Ltd. All rights reserved.%0A *%0A * Redistribution and use in source and/or binary forms, with or without%0A * modification, must retain the above copyright notice and the following%0A * disclaimer.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage io.spine.examples.todolist.mode.menu;%0A%0Aimport io.spine.examples.todolist.mode.Mode;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.DisplayName;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport static io.spine.examples.todolist.mode.menu.MenuItemTest.ExecutionCounterMode.getExecutedTimes;%0Aimport static io.spine.examples.todolist.mode.menu.MenuItemTest.ExecutionCounterMode.resetExecutionCounter;%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0A%0A/**%0A * @author Dmytro Grankin%0A */%0A@DisplayName(%22MenuItem should%22)%0Aclass MenuItemTest %7B%0A%0A    @BeforeEach%0A    void setUp() %7B%0A        resetExecutionCounter();%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22start the mode and parent%22)%0A    void startModes() %7B%0A        final Mode mode = new ExecutionCounterMode();%0A        final MenuItem menuItem = new MenuItem(%22The item%22, mode, mode);%0A%0A        menuItem.start();%0A        assertEquals(2, getExecutedTimes());%0A    %7D%0A%0A    static class ExecutionCounterMode extends Mode %7B%0A%0A        private static int executedTimes = 0;%0A%0A        @SuppressWarnings(%22AssignmentToStaticFieldFromInstanceMethod%22) // Needed for test purposes.%0A        @Override%0A        public void start() %7B%0A            executedTimes++;%0A        %7D%0A%0A        static int getExecutedTimes() %7B%0A            return executedTimes;%0A        %7D%0A%0A        static void resetExecutionCounter() %7B%0A            executedTimes = 0;%0A        %7D%0A    %7D%0A%7D%0A

Write tests for `MenuItem`