// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/providers/ResourceProvider.java
// public interface ResourceProvider {
// 
//     public Map<String, String> provideValues();
// 
//     public Set<String> provideInterface();
// 
//     public Set<String> provideMethod();
// 
//     public Set<String> provideAssignment();
// 
//     public Set<String> provideField();
// }
// 
// 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;
//     }
// }


import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.morcinek.android.codegenerator.codegeneration.providers.ResourceProvider;
import com.morcinek.android.codegenerator.codegeneration.templates.ResourceTemplatesProvider;
import org.apache.commons.lang3.StringUtils;
import org.fest.assertions.Assertions;
import org.junit.Test;
import org.mockito.Mockito;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.mockito.Mockito.when;
        // then
        Assertions.assertThat(value).isNotNull().isEqualTo("private View view;");
    }

    @Test
    public void builtTwoFieldString() throws Exception {
        // given
        interfaceBuilder = provideFieldsBuilder(Lists.newArrayList(getMockResourceProvider("button", null), getMockResourceProvider("view", Sets.newHashSet(""))));

        // when
        String value = interfaceBuilder.builtString();

        // then
        Assertions.assertThat(value).isNotNull().isEqualTo(
                "private View view;"
        );
    }

    @Test
    public void builtBFieldString() throws Exception {
        // given
        interfaceBuilder = provideFieldsBuilder(Lists.newArrayList(getMockResourceProvider("view", Sets.newHashSet("B"))));

        // when
        String value = interfaceBuilder.builtString();

        // then
        Assertions.assertThat(value).isNotNull().isEqualTo("@Bind(R.id.view) View view;");
    }

// Path: src/main/java/com/morcinek/android/codegenerator/codegeneration/providers/ResourceProvider.java
// public interface ResourceProvider {
// 
//     public Map<String, String> provideValues();
// 
//     public Set<String> provideInterface();
// 
//     public Set<String> provideMethod();
// 
//     public Set<String> provideAssignment();
// 
//     public Set<String> provideField();
// }
// 
// 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/test/java/com/morcinek/android/codegenerator/codegeneration/builders/resources/FieldsBuilderTest.java
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.morcinek.android.codegenerator.codegeneration.providers.ResourceProvider;
import com.morcinek.android.codegenerator.codegeneration.templates.ResourceTemplatesProvider;
import org.apache.commons.lang3.StringUtils;
import org.fest.assertions.Assertions;
import org.junit.Test;
import org.mockito.Mockito;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.mockito.Mockito.when;

        // then
        Assertions.assertThat(value).isNotNull().isEqualTo("private View view;");
    }

    @Test
    public void builtTwoFieldString() throws Exception {
        // given
        interfaceBuilder = provideFieldsBuilder(Lists.newArrayList(getMockResourceProvider("button", null), getMockResourceProvider("view", Sets.newHashSet(""))));

        // when
        String value = interfaceBuilder.builtString();

        // then
        Assertions.assertThat(value).isNotNull().isEqualTo(
                "private View view;"
        );
    }

    @Test
    public void builtBFieldString() throws Exception {
        // given
        interfaceBuilder = provideFieldsBuilder(Lists.newArrayList(getMockResourceProvider("view", Sets.newHashSet("B"))));

        // when
        String value = interfaceBuilder.builtString();

        // then
        Assertions.assertThat(value).isNotNull().isEqualTo("@Bind(R.id.view) View view;");
    }

    private ResourceProvider getMockResourceProvider(String name, Set<String> fields) {