protected override ITextGraphicComponent CreateTextComponent(ISpriteFont font)
        {
            var component = new TextGraphicComponentMock();
            CreatedComponents.Add(component);

            return component;
        }
Beispiel #2
0
        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);

        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }