Пример #1
0
        protected override ITextGraphicComponent CreateTextComponent(ISpriteFont font)
        {
            var component = new TextGraphicComponentMock();
            CreatedComponents.Add(component);

            return component;
        }
Пример #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);

        }
Пример #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);
        }
Пример #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);
        }