// Path: sft-core/src/main/java/sft/FixtureCall.java
// public class FixtureCall {
// 
//     public final UseCase useCase;
//     public final String name;
//     public final int line;
//     public final Fixture fixture;
//     public final int emptyLine;
//     public ArrayList<String> parametersValues = new ArrayList<String>();
// 
//     public FixtureCall(UseCase useCase, String name, int line, Fixture fixture, ArrayList<String> parametersValues, int emptyLine) {
//         this.useCase = useCase;
//         this.name = name;
//         this.line = line;
//         this.fixture= fixture;
//         this.emptyLine = emptyLine;
//         this.parametersValues.addAll(parametersValues);
//     }
// 
//     public Map<String, String> getParameters() {
//         final HashMap<String, String> parameters = new HashMap<String, String>();
//         for (int index = 0; index < fixture.parametersName.size(); index++) {
//             String name = fixture.parametersName.get(index);
//             String value = parametersValues.get(index);
//             parameters.put(name,value);
//         }
//         return parameters;
//     }
// }
// 
// Path: sft-md-report/src/main/java/sft/reports/markdown/MarkdownReport.java
// public class MarkdownReport extends Report {
//     private Map<Class<? extends Decorator>, DecoratorReportImplementation> decorators= new HashMap<Class<? extends Decorator>, DecoratorReportImplementation>();
// 
//     private TargetFolder folder;
//     private static final String TARGET_SFT_RESULT = "target/sft-result/";
//     public static final String MD_DEPENDENCIES_FOLDER = "sft-md-default";
// 
// 
//     public MarkdownReport(DefaultConfiguration configuration){
//         super(configuration);
//         decorators.put(NullDecorator.class,new MdNullDecorator(configuration));
//         folder=configuration.getProjectFolder().getTargetFolder(TARGET_SFT_RESULT);
//     }
// 
//     @Override
//     public DecoratorReportImplementation getDecoratorImplementation(Decorator decorator) {
//         DecoratorReportImplementation result = decorators.get(decorator.getClass());
//         if( result == null ){
//             result = new MdNullDecorator(configuration);
//         }
//         return result;
//     }
// 
//     @Override
//     public void addDecorator(Class<? extends Decorator> decoratorClass, DecoratorReportImplementation decoratorImplementation) {
//         decorators.put(decoratorClass,decoratorImplementation);
// 
//     }
// 
//     @Override
//     public void report(UseCaseResult useCaseResult) throws Exception {
//         folder.copyFromResources(MD_DEPENDENCIES_FOLDER);
//         final Decorator decorator = useCaseResult.useCase.useCaseDecorator;
//         DecoratorReportImplementation decoratorImplementation = getDecoratorImplementation(decorator);
//         String useCaseReport = decoratorImplementation.applyOnUseCase(useCaseResult, decorator.parameters);
// 
//         File mdFile = folder.createFileFromClass(useCaseResult.useCase.classUnderTest, ".md");
//         Writer html = new OutputStreamWriter(new FileOutputStream(mdFile));
//         html.write(useCaseReport);
//         html.close();
//         System.out.println("Report wrote: " + mdFile.getCanonicalPath());
//     }
// }


import sft.ContextHandler;
import sft.DefaultConfiguration;
import sft.FixtureCall;
import sft.UseCase;
import sft.decorators.DecoratorReportImplementation;
import sft.report.RelativePathResolver;
import sft.reports.markdown.MarkdownReport;
import sft.result.*;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
package sft.reports.markdown.decorators;



public class MdNullDecorator implements DecoratorReportImplementation {
    private final DefaultConfiguration configuration;
    private final RelativePathResolver pathResolver = new RelativePathResolver();

    public MdNullDecorator(DefaultConfiguration configuration) {
        this.configuration = configuration;
    }

    @Override
    public String applyOnUseCase(UseCaseResult useCaseResult, String... parameters) {
        String result = writeUseCaseName(useCaseResult.useCase, useCaseResult.getIssue());
        result += writeComment(useCaseResult.useCase.getComment());
        result += writeContext(useCaseResult.useCase.beforeUseCase);
        result += applyOnScenarios(useCaseResult.scenarioResults);
        result += writeContext(useCaseResult.useCase.afterUseCase);
        result += applyOnSubUseCases(useCaseResult.subUseCaseResults);
        return result;
    }

    private String writeContext(ContextHandler beforeUseCase) {
        String result = "";
        if(beforeUseCase != null && beforeUseCase.fixtureCalls !=null){
// Path: sft-core/src/main/java/sft/FixtureCall.java
// public class FixtureCall {
// 
//     public final UseCase useCase;
//     public final String name;
//     public final int line;
//     public final Fixture fixture;
//     public final int emptyLine;
//     public ArrayList<String> parametersValues = new ArrayList<String>();
// 
//     public FixtureCall(UseCase useCase, String name, int line, Fixture fixture, ArrayList<String> parametersValues, int emptyLine) {
//         this.useCase = useCase;
//         this.name = name;
//         this.line = line;
//         this.fixture= fixture;
//         this.emptyLine = emptyLine;
//         this.parametersValues.addAll(parametersValues);
//     }
// 
//     public Map<String, String> getParameters() {
//         final HashMap<String, String> parameters = new HashMap<String, String>();
//         for (int index = 0; index < fixture.parametersName.size(); index++) {
//             String name = fixture.parametersName.get(index);
//             String value = parametersValues.get(index);
//             parameters.put(name,value);
//         }
//         return parameters;
//     }
// }
// 
// Path: sft-md-report/src/main/java/sft/reports/markdown/MarkdownReport.java
// public class MarkdownReport extends Report {
//     private Map<Class<? extends Decorator>, DecoratorReportImplementation> decorators= new HashMap<Class<? extends Decorator>, DecoratorReportImplementation>();
// 
//     private TargetFolder folder;
//     private static final String TARGET_SFT_RESULT = "target/sft-result/";
//     public static final String MD_DEPENDENCIES_FOLDER = "sft-md-default";
// 
// 
//     public MarkdownReport(DefaultConfiguration configuration){
//         super(configuration);
//         decorators.put(NullDecorator.class,new MdNullDecorator(configuration));
//         folder=configuration.getProjectFolder().getTargetFolder(TARGET_SFT_RESULT);
//     }
// 
//     @Override
//     public DecoratorReportImplementation getDecoratorImplementation(Decorator decorator) {
//         DecoratorReportImplementation result = decorators.get(decorator.getClass());
//         if( result == null ){
//             result = new MdNullDecorator(configuration);
//         }
//         return result;
//     }
// 
//     @Override
//     public void addDecorator(Class<? extends Decorator> decoratorClass, DecoratorReportImplementation decoratorImplementation) {
//         decorators.put(decoratorClass,decoratorImplementation);
// 
//     }
// 
//     @Override
//     public void report(UseCaseResult useCaseResult) throws Exception {
//         folder.copyFromResources(MD_DEPENDENCIES_FOLDER);
//         final Decorator decorator = useCaseResult.useCase.useCaseDecorator;
//         DecoratorReportImplementation decoratorImplementation = getDecoratorImplementation(decorator);
//         String useCaseReport = decoratorImplementation.applyOnUseCase(useCaseResult, decorator.parameters);
// 
//         File mdFile = folder.createFileFromClass(useCaseResult.useCase.classUnderTest, ".md");
//         Writer html = new OutputStreamWriter(new FileOutputStream(mdFile));
//         html.write(useCaseReport);
//         html.close();
//         System.out.println("Report wrote: " + mdFile.getCanonicalPath());
//     }
// }


// Path: sft-md-report/src/main/java/sft/reports/markdown/decorators/MdNullDecorator.java
import sft.ContextHandler;
import sft.DefaultConfiguration;
import sft.FixtureCall;
import sft.UseCase;
import sft.decorators.DecoratorReportImplementation;
import sft.report.RelativePathResolver;
import sft.reports.markdown.MarkdownReport;
import sft.result.*;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;

package sft.reports.markdown.decorators;



public class MdNullDecorator implements DecoratorReportImplementation {
    private final DefaultConfiguration configuration;
    private final RelativePathResolver pathResolver = new RelativePathResolver();

    public MdNullDecorator(DefaultConfiguration configuration) {
        this.configuration = configuration;
    }

    @Override
    public String applyOnUseCase(UseCaseResult useCaseResult, String... parameters) {
        String result = writeUseCaseName(useCaseResult.useCase, useCaseResult.getIssue());
        result += writeComment(useCaseResult.useCase.getComment());
        result += writeContext(useCaseResult.useCase.beforeUseCase);
        result += applyOnScenarios(useCaseResult.scenarioResults);
        result += writeContext(useCaseResult.useCase.afterUseCase);
        result += applyOnSubUseCases(useCaseResult.subUseCaseResults);
        return result;
    }

    private String writeContext(ContextHandler beforeUseCase) {
        String result = "";
        if(beforeUseCase != null && beforeUseCase.fixtureCalls !=null){
            for (FixtureCall fixtureCall : beforeUseCase.fixtureCalls) {