Skip to content

Commit 32a577e

Browse files
author
Tobias van Driessel
committed
higher test coverage
1 parent 7ebebb8 commit 32a577e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: src/element/boxplot_outliers.rs

+28
Original file line numberDiff line numberDiff line change
@@ -392,4 +392,32 @@ mod test {
392392
.draw(&BoxplotOutliers::new_horizontal(1, &values))
393393
.is_ok());
394394
}
395+
396+
#[test]
397+
fn test_draw_with_outliers() {
398+
let root = MockedBackend::new(1024, 768).into_drawing_area();
399+
let chart = ChartBuilder::on(&root)
400+
.build_cartesian_2d(0..2, 0f32..100f32)
401+
.unwrap();
402+
403+
let values = BoxplotData::new(&[1,50,50,50,50,50,50,50,50,50,50,50,50,50]);
404+
assert!(chart
405+
.plotting_area()
406+
.draw(&BoxplotOutliers::new_vertical(1, &values))
407+
.is_ok());
408+
}
409+
410+
#[test]
411+
fn test_draw_with_outliers_two_sides() {
412+
let root = MockedBackend::new(1024, 768).into_drawing_area();
413+
let chart = ChartBuilder::on(&root)
414+
.build_cartesian_2d(0..2, 0f32..100f32)
415+
.unwrap();
416+
417+
let values = BoxplotData::new(&[1,50,50,50,50,50,100]);
418+
assert!(chart
419+
.plotting_area()
420+
.draw(&BoxplotOutliers::new_vertical(1, &values))
421+
.is_ok());
422+
}
395423
}

0 commit comments

Comments
 (0)