// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/providers/factories/MenuResourceProvidersFactory.java
// public class MenuResourceProvidersFactory implements ResourceProvidersFactory {
// 
//     @Override
//     public ResourceProvider createResourceProvider(Resource resource) {
//         return new MenuProvider(resource);
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/templates/ResourceTemplatesProvider.java
// public class ResourceTemplatesProvider implements TemplatesProvider {
// 
//     @Override
//     public String provideTemplateForName(String templateName) {
//         URL url = Resources.getResource(templateName);
//         try {
//             return Resources.toString(url, Charset.defaultCharset());
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/templates/TemplatesProvider.java
// public interface TemplatesProvider {
// 
//     String provideTemplateForName(String templateName);
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/extractor/model/Resource.java
// public class Resource {
// 
//     private ResourceId resourceId;
// 
//     private ResourceType resourceType;
// 
//     public Resource(ResourceId resourceId, ResourceType resourceType) {
//         this.resourceId = resourceId;
//         this.resourceType = resourceType;
//     }
// 
//     public ResourceId getResourceId() {
//         return resourceId;
//     }
// 
//     public ResourceType getResourceType() {
//         return resourceType;
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/extractor/model/ResourceId.java
// public class ResourceId {
// 
//     private String name;
// 
//     private String namespace;
// 
//     public ResourceId(String name) {
//         this.name = name;
//     }
// 
//     public ResourceId(String name, String namespace) {
//         this.name = name;
//         this.namespace = namespace;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getNamespace() {
//         return namespace;
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/extractor/model/ResourceType.java
// public class ResourceType {
// 
//     private String className;
// 
//     private String packageName;
// 
//     public ResourceType(String className) {
//         this.className = className;
//     }
// 
//     public ResourceType(String className, String packageName) {
//         this.className = className;
//         this.packageName = packageName;
//     }
// 
//     public String getClassName() {
//         return className;
//     }
// 
//     public String getPackageName() {
//         return packageName;
//     }
// 
//     public String getFullName() {
//         if (packageName != null) {
//             return packageName + "." + className;
//         }
//         return className;
//     }
// }


import com.google.common.collect.Lists;
import com.morcinek.android.codegenerator.codegeneration.providers.factories.MenuResourceProvidersFactory;
import com.morcinek.android.codegenerator.codegeneration.templates.ResourceTemplatesProvider;
import com.morcinek.android.codegenerator.codegeneration.templates.TemplatesProvider;
import com.morcinek.android.codegenerator.extractor.model.Resource;
import com.morcinek.android.codegenerator.extractor.model.ResourceId;
import com.morcinek.android.codegenerator.extractor.model.ResourceType;
import org.fest.assertions.Assertions;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
package com.morcinek.android.codegenerator.codegeneration;



public class MenuTemplateCodeGeneratorTest {

    private TemplatesProvider templatesProvider = new ResourceTemplatesProvider();

    private TemplateCodeGenerator templateCodeGenerator;

    @Before
    public void setUp() throws Exception {
        templateCodeGenerator = new TemplateCodeGenerator("Menu_template", new MenuResourceProvidersFactory(), new ResourceTemplatesProvider());
    }

    @Test
    public void produceCreateGameMenuCodeTest() throws Exception {
        // given
        List<Resource> resources = Lists.newArrayList(new Resource(new ResourceId("action_done"), new ResourceType("item")));

        // when
        String generatedCode = templateCodeGenerator.generateCode(resources, "create_game");

        // then
        String expectedCode = templatesProvider.provideTemplateForName("results/menus/CreateGame.java");
        Assertions.assertThat(generatedCode).isNotNull().isEqualTo(expectedCode);
    }

    @Test
    public void produceGameSessionMenuCodeTest() throws Exception {
        // given
        List<Resource> resources = Lists.newArrayList(
// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/providers/factories/MenuResourceProvidersFactory.java
// public class MenuResourceProvidersFactory implements ResourceProvidersFactory {
// 
//     @Override
//     public ResourceProvider createResourceProvider(Resource resource) {
//         return new MenuProvider(resource);
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/templates/ResourceTemplatesProvider.java
// public class ResourceTemplatesProvider implements TemplatesProvider {
// 
//     @Override
//     public String provideTemplateForName(String templateName) {
//         URL url = Resources.getResource(templateName);
//         try {
//             return Resources.toString(url, Charset.defaultCharset());
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/templates/TemplatesProvider.java
// public interface TemplatesProvider {
// 
//     String provideTemplateForName(String templateName);
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/extractor/model/Resource.java
// public class Resource {
// 
//     private ResourceId resourceId;
// 
//     private ResourceType resourceType;
// 
//     public Resource(ResourceId resourceId, ResourceType resourceType) {
//         this.resourceId = resourceId;
//         this.resourceType = resourceType;
//     }
// 
//     public ResourceId getResourceId() {
//         return resourceId;
//     }
// 
//     public ResourceType getResourceType() {
//         return resourceType;
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/extractor/model/ResourceId.java
// public class ResourceId {
// 
//     private String name;
// 
//     private String namespace;
// 
//     public ResourceId(String name) {
//         this.name = name;
//     }
// 
//     public ResourceId(String name, String namespace) {
//         this.name = name;
//         this.namespace = namespace;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getNamespace() {
//         return namespace;
//     }
// }
// 
// Path: src/main/java/com/morcinek/android/codegenerator/extractor/model/ResourceType.java
// public class ResourceType {
// 
//     private String className;
// 
//     private String packageName;
// 
//     public ResourceType(String className) {
//         this.className = className;
//     }
// 
//     public ResourceType(String className, String packageName) {
//         this.className = className;
//         this.packageName = packageName;
//     }
// 
//     public String getClassName() {
//         return className;
//     }
// 
//     public String getPackageName() {
//         return packageName;
//     }
// 
//     public String getFullName() {
//         if (packageName != null) {
//             return packageName + "." + className;
//         }
//         return className;
//     }
// }


// Path: src/test/java/com/morcinek/android/codegenerator/codegeneration/MenuTemplateCodeGeneratorTest.java
import com.google.common.collect.Lists;
import com.morcinek.android.codegenerator.codegeneration.providers.factories.MenuResourceProvidersFactory;
import com.morcinek.android.codegenerator.codegeneration.templates.ResourceTemplatesProvider;
import com.morcinek.android.codegenerator.codegeneration.templates.TemplatesProvider;
import com.morcinek.android.codegenerator.extractor.model.Resource;
import com.morcinek.android.codegenerator.extractor.model.ResourceId;
import com.morcinek.android.codegenerator.extractor.model.ResourceType;
import org.fest.assertions.Assertions;
import org.junit.Before;
import org.junit.Test;
import java.util.List;

package com.morcinek.android.codegenerator.codegeneration;



public class MenuTemplateCodeGeneratorTest {

    private TemplatesProvider templatesProvider = new ResourceTemplatesProvider();

    private TemplateCodeGenerator templateCodeGenerator;

    @Before
    public void setUp() throws Exception {
        templateCodeGenerator = new TemplateCodeGenerator("Menu_template", new MenuResourceProvidersFactory(), new ResourceTemplatesProvider());
    }

    @Test
    public void produceCreateGameMenuCodeTest() throws Exception {
        // given
        List<Resource> resources = Lists.newArrayList(new Resource(new ResourceId("action_done"), new ResourceType("item")));

        // when
        String generatedCode = templateCodeGenerator.generateCode(resources, "create_game");

        // then
        String expectedCode = templatesProvider.provideTemplateForName("results/menus/CreateGame.java");
        Assertions.assertThat(generatedCode).isNotNull().isEqualTo(expectedCode);
    }

    @Test
    public void produceGameSessionMenuCodeTest() throws Exception {
        // given
        List<Resource> resources = Lists.newArrayList(
                new Resource(new ResourceId("action_refresh"), new ResourceType("item")),