package cucumber.runtime.junit;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;

import cucumber.runner.ThreadLocalRunnerSupplier;
import cucumber.runtime.junit.PickleRunners.PickleRunner;
import gherkin.events.PickleEvent;
import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class PickleRunnerWithNoStepDescriptionsTest {

    @Test
    public void shouldUseScenarioNameWithFeatureNameAsClassNameForDisplayName() throws Exception {
        List<PickleEvent> pickles = TestPickleBuilder.pickleEventsFromFeature("featurePath", "" +
                "Feature: feature name\n" +
                "  Scenario: scenario name\n" +
                "    Then it works\n");

        PickleRunner runner = PickleRunners.withNoStepDescriptions(
                "feature name",
                mock(ThreadLocalRunnerSupplier.class),
                pickles.get(0),
                createJUnitOptions()
        );

        assertEquals("scenario name(feature name)", runner.getDescription().getDisplayName());
    }

    @Test
    public void shouldConvertTextFromFeatureFileForNamesWithFilenameCompatibleNameOption() throws Exception {
        List<PickleEvent> pickles = TestPickleBuilder.pickleEventsFromFeature("featurePath", "" +
                "Feature: feature name\n" +
                "  Scenario: scenario name\n" +
                "    Then it works\n");

        PickleRunner runner = PickleRunners.withNoStepDescriptions(
                "feature name",
                mock(ThreadLocalRunnerSupplier.class),
                pickles.get(0),
                createJUnitOptions("--filename-compatible-names")
        );

        assertEquals("scenario_name(feature_name)", runner.getDescription().getDisplayName());
    }

    private JUnitOptions createJUnitOptions() {
        return new JUnitOptions(true, Collections.<String>emptyList());
    }

    private JUnitOptions createJUnitOptions(String option) {
        return new JUnitOptions(true, Arrays.asList(option));
    }
}

@@ -1801,32 +1801,731 @@
 Name());%0A    %7D%0A%0A
+    @Test%0A    public void shouldConvertTextFromFeatureFileWithRussianLanguage() throws Exception %7B%0A        List%3CPickleEvent%3E pickles = TestPickleBuilder.pickleEventsFromFeature(%22featurePath%22, %22%22 +%0A            %22#language:ru%5Cn%22 +%0A            %22%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F: %D0%B8%D0%BC%D1%8F %D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B8%5Cn%22 +%0A            %22  %D0%A1%D1%86%D0%B5%D0%BD%D0%B0%D1%80%D0%B8%D0%B9: %D0%B8%D0%BC%D1%8F %D1%81%D1%86%D0%B5%D0%BD%D0%B0%D1%80%D0%B8%D1%8F%5Cn%22 +%0A            %22    %D0%A2%D0%BE%D0%B3%D0%B4%D0%B0 %D0%BE%D0%BD %D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D0%B5%D1%82%5Cn%22);%0A%0A        PickleRunner runner = PickleRunners.withNoStepDescriptions(%0A            %22%D0%B8%D0%BC%D1%8F %D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B8%22,%0A            mock(ThreadLocalRunnerSupplier.class),%0A            pickles.get(0),%0A            createJUnitOptions(%22--filename-compatible-names%22)%0A        );%0A%0A        assertEquals(%22____________(___________)%22, runner.getDescription().getDisplayName());%0A    %7D%0A%0A
     private JUni

Add test to prove TestPickleBuilder has error