Package com.sirenian.hellbound.domain

Examples of com.sirenian.hellbound.domain.Segments$Translator


  private static Segments[] def(Segments s1, Segments s2, Segments s3, Segments s4) {
    return new Segments[] { s1, s2, s3, s4 };
  }
 
  private static Segments rotation(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
    return new Segments(p(x1, y1), p(x2, y2), p(x3, y3), p(x4, y4));
  }
View Full Code Here


   
    PitPanel panel = createPitPanelWithDoublePaint(renderedPit);

    JFrame frame = createFrameAndDisplay(panel);
   
    panel.reportGlyphMovement(GlyphType.O, new Segments(new Segment[0]), INITIAL_SEGMENTS);
   
    panel.repaint();
    frame.dispose();   
       
        ensureThat(renderedPit, contains(INITIAL_SEGMENTS, Color.RED));
View Full Code Here

import com.sirenian.hellbound.domain.glyph.GlyphType;
import com.sirenian.hellbound.gui.RenderedPit;

public class TheGlyphShouldFallToTheBottom extends HellboundOutcome {
    public void verifyAnyTimeIn(World world) {
        Segments expectedSegments = new Segments(
                new Segment(2, 11),
                new Segment(3, 11),
                new Segment(4, 11),
                new Segment(3, 12)
        );
View Full Code Here

import com.sirenian.hellbound.gui.RenderedPit;
import com.sirenian.hellbound.stories.util.WorldKey;

public class TheGlyphShouldBeCentredAtTheTopOfThePit extends HellboundOutcome {
  public void verifyAnyTimeIn(World world) {
      Segments expectedSegments = T_SHAPE_AT_TOP;
      Color expectedColor = Hellbound.COLORMAP.getColorFor(GlyphType.T);
    RenderedPit graphics = (RenderedPit) world.get(WorldKey.PIT, null);
        Ensure.that(graphics, contains(expectedSegments, expectedColor));
  }
View Full Code Here

import com.sirenian.hellbound.domain.glyph.GlyphType;
import com.sirenian.hellbound.stories.util.WorldKey;

public class TheGlyphShouldMoveRight extends HellboundOutcome {
    protected void verifyAnyTimeIn(World world) {
        Segments expectedSegments = T_SHAPE_AT_TOP.movedRight();
        Color expectedColor =  Hellbound.COLORMAP.getColorFor(GlyphType.T);
        Object pit = world.get(WorldKey.PIT);
        ensureThat(pit, contains(expectedSegments, expectedColor));
    }
View Full Code Here

        return newMock(FieldTranslator.class);
    }

    protected final Translator mockTranslator(String name, Class type)
    {
        Translator translator = mockTranslator();

        train_getName(translator, name);
        train_getType(translator, type);

        return translator;
View Full Code Here


    @Test
    public void found_translator_by_name()
    {
        Translator translator = mockTranslator("mock", String.class);

        Collection<Translator> configuration = CollectionFactory.newList(translator);

        replay();
View Full Code Here

    }

    @Test
    public void unknown_translator_is_failure()
    {
        Translator fred = mockTranslator("fred", String.class);
        Translator barney = mockTranslator("barney", Long.class);

        Collection<Translator> configuration = CollectionFactory.newList(fred, barney);

        replay();
View Full Code Here

    }

    @Test(dataProvider = "to_client_data")
    public void to_client(Class type, Object value, String expected)
    {
        Translator t = source.getByType(type);

        String actual = t.toClient(value);

        assertEquals(actual, expected);
    }
View Full Code Here

    }

    @Test(dataProvider = "parse_client_success_data")
    public void parse_client(Class type, String input, Object expected) throws Exception
    {
        Translator t = source.getByType(type);

        Object actual = t.parseClient(null, input, null);

        assertEquals(actual, expected);
    }
View Full Code Here

TOP

Related Classes of com.sirenian.hellbound.domain.Segments$Translator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.