Skip to content
Snippets Groups Projects
Commit 85896e0d authored by Tim Molter's avatar Tim Molter
Browse files

removed useless unit tests

parent e6ee33bc
Branches
No related tags found
No related merge requests found
/**
* Copyright 2011 - 2014 Xeiam LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.xeiam.xchart;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import com.xeiam.xchart.internal.chartpart.Axis.Direction;
import com.xeiam.xchart.internal.chartpart.AxisTickDateCalculator;
/**
* @author timmolter
*/
public class DateAxisTickCalculatorTest {
@Test
public void testDateOneMinuteTimespan() {
AxisTickDateCalculator axisTickDateCalculator = new AxisTickDateCalculator(Direction.X, 600, 1361110661000.0, 1361110721000.0, new StyleManager());
List<String> tickLabels = axisTickDateCalculator.getTickLabels();
System.out.println(Arrays.toString(tickLabels.toArray()));
assertThat(tickLabels.size(), equalTo(7));
assertThat(tickLabels.get(0), equalTo("17:40"));
List<Double> tickLocations = axisTickDateCalculator.getTickLocations();
System.out.println(Arrays.toString(tickLocations.toArray()));
assertThat(tickLocations.size(), equalTo(7));
assertThat(tickLocations.get(0), equalTo(5.5));
}
}
/**
* Copyright 2011 - 2014 Xeiam LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.xeiam.xchart;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import com.xeiam.xchart.internal.chartpart.Axis.Direction;
import com.xeiam.xchart.internal.chartpart.AxisTickNumericalCalculator;
/**
* @author timmolter
*/
public class DecimalAxisTickCalculatorTest {
@Test
public void testDateOneMinuteTimespan() {
AxisTickNumericalCalculator decimalAxisTickCalculator = new AxisTickNumericalCalculator(Direction.X, 600, -15, 15, new StyleManager());
List<String> tickLabels = decimalAxisTickCalculator.getTickLabels();
System.out.println(Arrays.toString(tickLabels.toArray()));
assertThat(tickLabels.size(), equalTo(7));
assertThat(tickLabels.get(0), equalTo("-15"));
List<Double> tickLocations = decimalAxisTickCalculator.getTickLocations();
System.out.println(Arrays.toString(tickLocations.toArray()));
assertThat(tickLocations.size(), equalTo(7));
assertThat(tickLocations.get(0), equalTo(15.0));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment