Skip to content

Commit

Permalink
Update some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Mar 23, 2022
1 parent a5e5b3c commit 25b7e49
Show file tree
Hide file tree
Showing 8 changed files with 758 additions and 2,690 deletions.
1,303 changes: 273 additions & 1,030 deletions test/chart/bar_chart/bar_chart_painter_test.dart

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions test/chart/bar_chart/bar_chart_renderer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ void main() {
group('BarChartRenderer', () {
final BarChartData data = BarChartData(
titlesData: FlTitlesData(
leftTitles: SideTitles(reservedSize: 12, margin: 8, showTitles: true),
rightTitles: SideTitles(reservedSize: 44, margin: 20, showTitles: true),
topTitles: SideTitles(showTitles: false),
bottomTitles: SideTitles(showTitles: false),
leftTitles: AxisTitles(sideTitles: SideTitles(reservedSize: 20, showTitles: true)),
rightTitles: AxisTitles(sideTitles: SideTitles(reservedSize: 64, showTitles: true)),
topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
bottomTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
));

final BarChartData targetData = BarChartData(
titlesData: FlTitlesData(
leftTitles: SideTitles(reservedSize: 0, margin: 8, showTitles: true),
rightTitles: SideTitles(reservedSize: 0, margin: 20, showTitles: true),
topTitles: SideTitles(showTitles: false),
bottomTitles: SideTitles(showTitles: false),
leftTitles: AxisTitles(sideTitles: SideTitles(reservedSize: 8, showTitles: true)),
rightTitles: AxisTitles(sideTitles: SideTitles(reservedSize: 20, showTitles: true)),
topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
bottomTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
));

const textScale = 4.0;
Expand Down
48 changes: 17 additions & 31 deletions test/chart/base/axis_chart_data_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,30 @@ import '../data_pool.dart';

void main() {
group('AxisChartData data equality check', () {
test('FlAxisTitleData equality test', () {
expect(flAxisTitleData1 == flAxisTitleData1Clone, true);
expect(flAxisTitleData1 == flAxisTitleData2, false);
expect(flAxisTitleData1 == flAxisTitleData3, false);
expect(flAxisTitleData1 == flAxisTitleData4, false);
expect(flAxisTitleData1 == flAxisTitleData5, false);
expect(flAxisTitleData1 == flAxisTitleData6, false);
expect(flAxisTitleData1 == flAxisTitleData7, false);
expect(flAxisTitleData1 == flAxisTitleData8, false);
});

test('AxisTitle equality test', () {
expect(axisTitle1 == axisTitle1Clone, true);
expect(axisTitle1 == axisTitle2, false);
expect(axisTitle1 == axisTitle3, false);
expect(axisTitle1 == axisTitle4, false);
expect(axisTitle1 == axisTitle5, false);
expect(axisTitle1 == axisTitle6, false);
expect(axisTitle1 == axisTitle7, false);
expect(axisTitle1 == axisTitle8, false);
expect(MockData.axisTitles1 == MockData.axisTitles1Clone, true);
expect(MockData.axisTitles1 == MockData.axisTitles2, false);
expect(MockData.axisTitles1 == MockData.axisTitles3, false);
expect(MockData.axisTitles1 == MockData.axisTitles4, false);
expect(MockData.axisTitles1 == MockData.axisTitles5, false);
});

test('FlTitlesData equality test', () {
expect(flTitlesData1 == flTitlesData1Clone, true);
expect(flTitlesData1 == flTitlesData2, false);
expect(flTitlesData1 == flTitlesData3, false);
expect(flTitlesData1 == flTitlesData4, false);
expect(flTitlesData1 == flTitlesData5, false);
expect(flTitlesData1 == flTitlesData6, false);
expect(MockData.flTitlesData1 == MockData.flTitlesData1Clone, true);
expect(MockData.flTitlesData1 == MockData.flTitlesData2, false);
expect(MockData.flTitlesData1 == MockData.flTitlesData3, false);
expect(MockData.flTitlesData1 == MockData.flTitlesData4, false);
expect(MockData.flTitlesData1 == MockData.flTitlesData5, false);
expect(MockData.flTitlesData1 == MockData.flTitlesData6, false);
});

test('SideTitles equality test', () {
expect(sideTitles1 == sideTitles1Clone, true);
expect(sideTitles1 == sideTitles2, false);
expect(sideTitles1 == sideTitles3, false);
expect(sideTitles1 == sideTitles4, false);
expect(sideTitles1 == sideTitles5, false);
expect(sideTitles1 == sideTitles6, false);
expect(MockData.sideTitles1 == MockData.sideTitles1Clone, true);
expect(MockData.sideTitles1 == MockData.sideTitles2, false);
expect(MockData.sideTitles1 == MockData.sideTitles3, false);
expect(MockData.sideTitles1 == MockData.sideTitles4, false);
expect(MockData.sideTitles1 == MockData.sideTitles5, false);
expect(MockData.sideTitles1 == MockData.sideTitles6, false);
});

test('FlSpot equality test', () {
Expand Down
Loading

0 comments on commit 25b7e49

Please sign in to comment.