protected override ITextGraphicComponent CreateTextComponent(ISpriteFont font) { var component = new TextGraphicComponentMock(); CreatedComponents.Add(component); return component; }
private ItemBox CreateItemBox(IGraphicComponent arrow = null, ITextGraphicComponent text = null) { if (arrow == null) arrow = new GraphicComponentMock(); if (text == null) text = new TextGraphicComponentMock(); return new ItemBox(arrow, text); }
public void Draw_UnselectedDraw_ArrowNotDrawn(float x, float y, float width, float height) { SpriteBatchMock spriteBatch = new SpriteBatchMock(); var arrow = new GraphicComponentMock(); var textBox = new TextGraphicComponentMock(); var item = CreateItemBox(arrow, textBox); item.SetCoordinates(x, y, width, height); item.Draw(spriteBatch); Assert.False(arrow.WasDrawn); }
public void Draw_SelectedDraw_ArroLeftOfText(float x, float y, float width, float height) { SpriteBatchMock spriteBatch = new SpriteBatchMock(); var arrow = new GraphicComponentMock(); var textBox = new TextGraphicComponentMock(); var item = CreateItemBox(arrow, textBox); item.SetCoordinates(x, y, width, height); item.Select(); item.Draw(spriteBatch); Assert.LessOrEqual(arrow.XPosition, textBox.XPosition); }