/* * * Copyright (C) 2007-2015 Licensed to the Comunes Association (CA) under * one or more contributor license agreements (see COPYRIGHT for details). * The CA licenses this file to you under the GNU Affero General Public * License version 3, (the "License"); you may not use this file except in * compliance with the License. This file is part of kune. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package cc.kune.common.client.tooltip; /** * The Class TooltipPositionCalculatorTest. * * @author vjrj@ourproject.org (Vicente J. Ruiz Jurado) */ public class TooltipPositionCalculatorTest { // private static final int TOOLTIP_HEIGHT = 100; // private static final int TOOLTIP_WIDTH = 100; // private static final int WINDOW_HEIGHT = 480; // private static final int WINDOW_WIDTH = 640; // // @Test // public void testWhenNoOverflow() { // final TooltipPosition position = // TooltipPositionCalculator.calculate(WINDOW_WIDTH, WINDOW_HEIGHT, 0, // 0, 10, 10, TOOLTIP_WIDTH, TOOLTIP_HEIGHT); // assertEquals(ArrowPosition.NW, position.getArrowPosition()); // assertEquals(TooltipPosition.ARROW_DEF_MARGIN, position.getArrowLeft()); // assertEquals(0, position.getArrowTop()); // assertEquals(TooltipPosition.TOOLTIP_DISTANCE, position.getLeft()); // assertEquals(TooltipPosition.TOOLTIP_DISTANCE, position.getTop()); // } // // @Test // public void testWhenOverflowWidth() { // final TooltipPosition position = // TooltipPositionCalculator.calculate(WINDOW_WIDTH, WINDOW_HEIGHT, // WINDOW_WIDTH, 0, 10, 10, TOOLTIP_WIDTH, TOOLTIP_HEIGHT); // assertEquals(ArrowPosition.NE, position.getArrowPosition()); // assertEquals(TOOLTIP_WIDTH - TooltipPosition.ARROW_DEF_MARGIN, // position.getArrowLeft()); // assertEquals(0, position.getArrowTop()); // assertEquals(WINDOW_WIDTH - TOOLTIP_WIDTH + // TooltipPosition.TOOLTIP_DISTANCE, position.getLeft()); // assertEquals(TooltipPosition.TOOLTIP_DISTANCE, position.getTop()); // } }