@@ -0,0 +1,3042 @@
+package com.episode6.hackit.mockspresso.internal;%0A%0Aimport com.episode6.hackit.mockspresso.DefaultTestRunner;%0Aimport com.episode6.hackit.mockspresso.exception.CircularDependencyError;%0Aimport com.episode6.hackit.mockspresso.reflect.DependencyKey;%0Aimport com.episode6.hackit.mockspresso.reflect.TypeToken;%0Aimport com.episode6.hackit.mockspresso.testobject.SubclassTestObject;%0Aimport com.episode6.hackit.mockspresso.testobject.SuperclassTestObject;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport java.util.Iterator;%0A%0A/**%0A * Tests %7B@link DependencyValidator%7D%0A */%0A@RunWith(DefaultTestRunner.class)%0Apublic class DependencyValidatorTest %7B%0A%0A  @Test%0A  public void testBaseValidator() %7B%0A    createBaseValidator();%0A    // no exception == pass%0A  %7D%0A%0A  @Test(expected = CircularDependencyError.class)%0A  public void testBadValidator() %7B%0A    createBadValidator();%0A  %7D%0A%0A  @Test%0A  public void testWorkingAppend() %7B%0A    createValidatorToAppendTo().append(createBaseValidator());%0A    // no exception == pass%0A  %7D%0A%0A  @Test(expected = CircularDependencyError.class)%0A  public void testFailedAppend() %7B%0A    createBadValidatorToAppendTo().append(createBaseValidator());%0A  %7D%0A%0A  private static DependencyValidator createBaseValidator() %7B%0A    DependencyValidator topLevel = new DependencyValidator(DependencyKey.of(TestClass.class));%0A    topLevel.child(DependencyKey.of(String.class));%0A    topLevel.child(DependencyKey.of(Integer.class));%0A    DependencyValidator secondLevel = topLevel.child(DependencyKey.of(Iterator.class));%0A    secondLevel.child(DependencyKey.of(new TypeToken%3CIterable%3CString%3E%3E() %7B%7D));%0A    secondLevel.child(DependencyKey.of(String.class)); // not a direct descendant of the other string.%0A    return topLevel;%0A  %7D%0A%0A  private static DependencyValidator createBadValidator() %7B%0A    DependencyValidator topLevel = new DependencyValidator(DependencyKey.of(TestClass.class));%0A    topLevel.child(DependencyKey.of(String.class));%0A    topLevel.child(DependencyKey.of(Integer.class));%0A    DependencyValidator secondLevel = topLevel.child(DependencyKey.of(Iterator.class));%0A    DependencyValidator thirdLevel = secondLevel.child(DependencyKey.of(new TypeToken%3CIterable%3CString%3E%3E() %7B%7D));%0A    thirdLevel.child(DependencyKey.of(TestClass.class));%0A    return topLevel;%0A  %7D%0A%0A  private static DependencyValidator createValidatorToAppendTo() %7B%0A    DependencyValidator topLevel = new DependencyValidator(DependencyKey.of(Exception.class));%0A    return topLevel%0A        .child(DependencyKey.of(SubclassTestObject.class))%0A        .child(DependencyKey.of(SuperclassTestObject.class))%0A        .child(DependencyKey.of(TestClass.class));%0A  %7D%0A%0A  private static DependencyValidator createBadValidatorToAppendTo() %7B%0A    DependencyValidator topLevel = new DependencyValidator(DependencyKey.of(new TypeToken%3CIterable%3CString%3E%3E() %7B%7D));%0A    return topLevel%0A        .child(DependencyKey.of(SubclassTestObject.class))%0A        .child(DependencyKey.of(SuperclassTestObject.class))%0A        .child(DependencyKey.of(TestClass.class));%0A  %7D%0A%0A  public static class TestClass %7B%7D%0A%7D%0A

Add a few basic tests for DependencyValidator