From 654bb200021eab231be84649518b8dd2a11732de Mon Sep 17 00:00:00 2001 From: Christian Findlay <16697547+MelbourneDeveloper@users.noreply.github.com> Date: Fri, 20 Sep 2024 08:54:43 +1000 Subject: [PATCH] Put the range tick provider test back --- charts_common/analysis_options.yaml | 1 + charts_common/pubspec.yaml | 3 +- .../axis/range_tick_provider_test.dart | 244 +++++ charts_common/test/mox.dart | 11 + charts_common/test/mox.mocks.dart | 895 ++++++++++++++++++ 5 files changed, 1153 insertions(+), 1 deletion(-) create mode 100644 charts_common/test/chart/cartesian/axis/range_tick_provider_test.dart create mode 100644 charts_common/test/mox.dart create mode 100644 charts_common/test/mox.mocks.dart diff --git a/charts_common/analysis_options.yaml b/charts_common/analysis_options.yaml index 0b2f8dd31..122c99583 100644 --- a/charts_common/analysis_options.yaml +++ b/charts_common/analysis_options.yaml @@ -19,6 +19,7 @@ analyzer: inference_failure_on_function_invocation: warning # Probably OK + unreachable_from_main: warning prefer_asserts_in_initializer_lists: warning avoid_classes_with_only_static_members: warning prefer_function_declarations_over_variables: warning diff --git a/charts_common/pubspec.yaml b/charts_common/pubspec.yaml index 5094e8422..e718df1d8 100644 --- a/charts_common/pubspec.yaml +++ b/charts_common/pubspec.yaml @@ -15,5 +15,6 @@ dependencies: dev_dependencies: austerity: ^1.2.0 - mockito: ^5.0.0 + build_runner: ^2.4.12 + mockito: ^5.4.4 test: ^1.5.3 diff --git a/charts_common/test/chart/cartesian/axis/range_tick_provider_test.dart b/charts_common/test/chart/cartesian/axis/range_tick_provider_test.dart new file mode 100644 index 000000000..7b2bcdc18 --- /dev/null +++ b/charts_common/test/chart/cartesian/axis/range_tick_provider_test.dart @@ -0,0 +1,244 @@ +// Copyright 2018 the Charts project authors. Please see the AUTHORS file +// for details. +// +// 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. + +// import 'package:mockito/mockito.dart'; + +import 'package:nimble_charts_common/src/chart/cartesian/axis/draw_strategy/base_tick_draw_strategy.dart'; +import 'package:nimble_charts_common/src/chart/cartesian/axis/linear/linear_scale.dart'; +import 'package:nimble_charts_common/src/chart/cartesian/axis/range_tick_provider.dart'; +import 'package:nimble_charts_common/src/chart/cartesian/axis/scale.dart'; +import 'package:nimble_charts_common/src/chart/cartesian/axis/spec/range_tick_spec.dart'; +import 'package:nimble_charts_common/src/chart/cartesian/axis/spec/tick_spec.dart'; +import 'package:nimble_charts_common/src/chart/cartesian/axis/tick_formatter.dart'; +import 'package:nimble_charts_common/src/chart/common/chart_context.dart'; +import 'package:test/test.dart'; + +import '../../../mox.mocks.dart'; + +class FakeNumericTickFormatter implements TickFormatter { + int calledTimes = 0; + + @override + List format( + List tickValues, + Map cache, { + num? stepSize, + }) { + calledTimes += 1; + + return tickValues.map((value) => value.toString()).toList(); + } +} + +void main() { + late ChartContext context; + late MockGraphicsFactory graphicsFactory; + late TickFormatter formatter; + late BaseTickDrawStrategy drawStrategy; + late LinearScale scale; + + setUp(() { + context = MockChartContext(); + graphicsFactory = MockGraphicsFactory(); + formatter = MockNumericTickFormatter(); + drawStrategy = MockDrawStrategy(); + scale = LinearScale()..range = const ScaleOutputExtent(0, 300); + }); + + group('scale is extended with range tick values', () { + test('values extend existing domain values', () { + final tickProvider = RangeTickProvider([ + const TickSpec(20200601, label: '20200601'), + const TickSpec(20200608, label: '20200608'), + const TickSpec(20200615, label: '20200615'), + const RangeTickSpec( + 20200531, + label: 'Week 1', + rangeStartValue: 20200531, + rangeEndValue: 20200607, + ), + const RangeTickSpec( + 20200607, + label: 'Week 2', + rangeStartValue: 20200607, + rangeEndValue: 20200614, + ), + const RangeTickSpec( + 20200614, + label: 'Week 3', + rangeStartValue: 20200614, + rangeEndValue: 20200621, + ), + ]); + + scale + ..addDomain(20200601) + ..addDomain(20200607); + + expect(scale.dataExtent.min, equals(20200601)); + expect(scale.dataExtent.max, equals(20200607)); + + tickProvider.getTicks( + context: context, + graphicsFactory: graphicsFactory, + scale: scale, + formatter: formatter, + formatterValueCache: {}, + tickDrawStrategy: drawStrategy, + orientation: null, + ); + + expect(scale.dataExtent.min, equals(20200531)); + expect(scale.dataExtent.max, equals(20200621)); + }); + + test('values within data extent', () { + final tickProvider = RangeTickProvider([ + const TickSpec(20200601, label: '20200601'), + const TickSpec(20200608, label: '20200608'), + const RangeTickSpec( + 20200531, + label: 'Week 1', + rangeStartValue: 20200531, + rangeEndValue: 20200607, + ), + const RangeTickSpec( + 20200607, + label: 'Week 2', + rangeStartValue: 20200607, + rangeEndValue: 20200614, + ), + ]); + + scale + ..addDomain(20200401) + ..addDomain(20200701); + + expect(scale.dataExtent.min, equals(20200401)); + expect(scale.dataExtent.max, equals(20200701)); + + tickProvider.getTicks( + context: context, + graphicsFactory: graphicsFactory, + scale: scale, + formatter: formatter, + formatterValueCache: {}, + tickDrawStrategy: drawStrategy, + orientation: null, + ); + + expect(scale.dataExtent.min, equals(20200401)); + expect(scale.dataExtent.max, equals(20200701)); + }); + }); + + group('formatter', () { + test('is not called when all ticks have labels', () { + final tickProvider = RangeTickProvider([ + const TickSpec(20200601, label: '20200601'), + const TickSpec(20200608, label: '20200608'), + const RangeTickSpec( + 20200531, + label: 'Week 1', + rangeStartValue: 20200531, + rangeEndValue: 20200607, + ), + const RangeTickSpec( + 20200607, + label: 'Week 2', + rangeStartValue: 20200607, + rangeEndValue: 20200614, + ), + ]); + + final fakeFormatter = FakeNumericTickFormatter(); + + tickProvider.getTicks( + context: context, + graphicsFactory: graphicsFactory, + scale: scale, + formatter: fakeFormatter, + formatterValueCache: {}, + tickDrawStrategy: drawStrategy, + orientation: null, + ); + + expect(fakeFormatter.calledTimes, equals(0)); + }); + + test('is called when one ticks does not have label', () { + final tickProvider = RangeTickProvider([ + const TickSpec(20200601, label: '20200601'), + const TickSpec(20200608, label: '20200608'), + const RangeTickSpec( + 20200531, + rangeStartValue: 20200531, + rangeEndValue: 20200607, + ), + const RangeTickSpec( + 20200607, + label: 'Week 2', + rangeStartValue: 20200607, + rangeEndValue: 20200614, + ), + ]); + + final fakeFormatter = FakeNumericTickFormatter(); + + tickProvider.getTicks( + context: context, + graphicsFactory: graphicsFactory, + scale: scale, + formatter: fakeFormatter, + formatterValueCache: {}, + tickDrawStrategy: drawStrategy, + orientation: null, + ); + + expect(fakeFormatter.calledTimes, equals(1)); + }); + + test('is called when all ticks do not have labels', () { + final tickProvider = RangeTickProvider([ + const TickSpec(20200601), + const TickSpec(20200608), + const RangeTickSpec( + 20200531, + rangeStartValue: 20200531, + rangeEndValue: 20200607, + ), + const RangeTickSpec( + 20200607, + rangeStartValue: 20200607, + rangeEndValue: 20200614, + ), + ]); + + final fakeFormatter = FakeNumericTickFormatter(); + + tickProvider.getTicks( + context: context, + graphicsFactory: graphicsFactory, + scale: scale, + formatter: fakeFormatter, + formatterValueCache: {}, + tickDrawStrategy: drawStrategy, + orientation: null, + ); + + expect(fakeFormatter.calledTimes, equals(1)); + }); + }); +} diff --git a/charts_common/test/mox.dart b/charts_common/test/mox.dart new file mode 100644 index 000000000..688180e69 --- /dev/null +++ b/charts_common/test/mox.dart @@ -0,0 +1,11 @@ +import 'package:mockito/annotations.dart'; +import 'package:nimble_charts_common/common.dart'; + +@GenerateNiceMocks([ + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec>(as: #MockNumericTickFormatter), + MockSpec(as: #MockDrawStrategy), +]) +void main() {} diff --git a/charts_common/test/mox.mocks.dart b/charts_common/test/mox.mocks.dart new file mode 100644 index 000000000..13885499b --- /dev/null +++ b/charts_common/test/mox.mocks.dart @@ -0,0 +1,895 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in nimble_charts_common/test/mox.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:math' as _i19; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i12; +import 'package:nimble_charts_common/src/chart/cartesian/axis/axis.dart' + as _i17; +import 'package:nimble_charts_common/src/chart/cartesian/axis/collision_report.dart' + as _i9; +import 'package:nimble_charts_common/src/chart/cartesian/axis/draw_strategy/base_tick_draw_strategy.dart' + as _i14; +import 'package:nimble_charts_common/src/chart/cartesian/axis/spec/axis_spec.dart' + as _i15; +import 'package:nimble_charts_common/src/chart/cartesian/axis/tick.dart' + as _i16; +import 'package:nimble_charts_common/src/chart/cartesian/axis/tick_formatter.dart' + as _i13; +import 'package:nimble_charts_common/src/chart/common/behavior/a11y/a11y_node.dart' + as _i11; +import 'package:nimble_charts_common/src/chart/common/chart_canvas.dart' + as _i18; +import 'package:nimble_charts_common/src/chart/common/chart_context.dart' + as _i7; +import 'package:nimble_charts_common/src/chart/layout/layout_view.dart' as _i10; +import 'package:nimble_charts_common/src/common/date_time_factory.dart' as _i2; +import 'package:nimble_charts_common/src/common/graphics_factory.dart' as _i8; +import 'package:nimble_charts_common/src/common/line_style.dart' as _i3; +import 'package:nimble_charts_common/src/common/text_element.dart' as _i5; +import 'package:nimble_charts_common/src/common/text_measurement.dart' as _i6; +import 'package:nimble_charts_common/src/common/text_style.dart' as _i4; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeDateTimeFactory_0 extends _i1.SmartFake + implements _i2.DateTimeFactory { + _FakeDateTimeFactory_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeLineStyle_1 extends _i1.SmartFake implements _i3.LineStyle { + _FakeLineStyle_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTextStyle_2 extends _i1.SmartFake implements _i4.TextStyle { + _FakeTextStyle_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTextElement_3 extends _i1.SmartFake implements _i5.TextElement { + _FakeTextElement_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTextMeasurement_4 extends _i1.SmartFake + implements _i6.TextMeasurement { + _FakeTextMeasurement_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeChartContext_5 extends _i1.SmartFake implements _i7.ChartContext { + _FakeChartContext_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGraphicsFactory_6 extends _i1.SmartFake + implements _i8.GraphicsFactory { + _FakeGraphicsFactory_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeCollisionReport_7 extends _i1.SmartFake + implements _i9.CollisionReport { + _FakeCollisionReport_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeViewMeasuredSizes_8 extends _i1.SmartFake + implements _i10.ViewMeasuredSizes { + _FakeViewMeasuredSizes_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ChartContext]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockChartContext extends _i1.Mock implements _i7.ChartContext { + @override + bool get chartContainerIsRtl => (super.noSuchMethod( + Invocation.getter(#chartContainerIsRtl), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + bool get isRtl => (super.noSuchMethod( + Invocation.getter(#isRtl), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + bool get isTappable => (super.noSuchMethod( + Invocation.getter(#isTappable), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + double get pixelsPerDp => (super.noSuchMethod( + Invocation.getter(#pixelsPerDp), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + + @override + _i2.DateTimeFactory get dateTimeFactory => (super.noSuchMethod( + Invocation.getter(#dateTimeFactory), + returnValue: _FakeDateTimeFactory_0( + this, + Invocation.getter(#dateTimeFactory), + ), + returnValueForMissingStub: _FakeDateTimeFactory_0( + this, + Invocation.getter(#dateTimeFactory), + ), + ) as _i2.DateTimeFactory); + + @override + void requestRedraw() => super.noSuchMethod( + Invocation.method( + #requestRedraw, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void requestAnimation(Duration? transition) => super.noSuchMethod( + Invocation.method( + #requestAnimation, + [transition], + ), + returnValueForMissingStub: null, + ); + + @override + void requestPaint() => super.noSuchMethod( + Invocation.method( + #requestPaint, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void enableA11yExploreMode( + List<_i11.A11yNode>? nodes, { + String? announcement, + }) => + super.noSuchMethod( + Invocation.method( + #enableA11yExploreMode, + [nodes], + {#announcement: announcement}, + ), + returnValueForMissingStub: null, + ); + + @override + void disableA11yExploreMode({String? announcement}) => super.noSuchMethod( + Invocation.method( + #disableA11yExploreMode, + [], + {#announcement: announcement}, + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [GraphicsFactory]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockGraphicsFactory extends _i1.Mock implements _i8.GraphicsFactory { + @override + _i3.LineStyle createLinePaint() => (super.noSuchMethod( + Invocation.method( + #createLinePaint, + [], + ), + returnValue: _FakeLineStyle_1( + this, + Invocation.method( + #createLinePaint, + [], + ), + ), + returnValueForMissingStub: _FakeLineStyle_1( + this, + Invocation.method( + #createLinePaint, + [], + ), + ), + ) as _i3.LineStyle); + + @override + _i4.TextStyle createTextPaint() => (super.noSuchMethod( + Invocation.method( + #createTextPaint, + [], + ), + returnValue: _FakeTextStyle_2( + this, + Invocation.method( + #createTextPaint, + [], + ), + ), + returnValueForMissingStub: _FakeTextStyle_2( + this, + Invocation.method( + #createTextPaint, + [], + ), + ), + ) as _i4.TextStyle); + + @override + _i5.TextElement createTextElement(String? text) => (super.noSuchMethod( + Invocation.method( + #createTextElement, + [text], + ), + returnValue: _FakeTextElement_3( + this, + Invocation.method( + #createTextElement, + [text], + ), + ), + returnValueForMissingStub: _FakeTextElement_3( + this, + Invocation.method( + #createTextElement, + [text], + ), + ), + ) as _i5.TextElement); +} + +/// A class which mocks [TextElement]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTextElement extends _i1.Mock implements _i5.TextElement { + @override + set textStyle(_i4.TextStyle? value) => super.noSuchMethod( + Invocation.setter( + #textStyle, + value, + ), + returnValueForMissingStub: null, + ); + + @override + set maxWidth(int? value) => super.noSuchMethod( + Invocation.setter( + #maxWidth, + value, + ), + returnValueForMissingStub: null, + ); + + @override + set maxWidthStrategy(_i5.MaxWidthStrategy? maxWidthStrategy) => + super.noSuchMethod( + Invocation.setter( + #maxWidthStrategy, + maxWidthStrategy, + ), + returnValueForMissingStub: null, + ); + + @override + set opacity(double? opacity) => super.noSuchMethod( + Invocation.setter( + #opacity, + opacity, + ), + returnValueForMissingStub: null, + ); + + @override + String get text => (super.noSuchMethod( + Invocation.getter(#text), + returnValue: _i12.dummyValue( + this, + Invocation.getter(#text), + ), + returnValueForMissingStub: _i12.dummyValue( + this, + Invocation.getter(#text), + ), + ) as String); + + @override + _i6.TextMeasurement get measurement => (super.noSuchMethod( + Invocation.getter(#measurement), + returnValue: _FakeTextMeasurement_4( + this, + Invocation.getter(#measurement), + ), + returnValueForMissingStub: _FakeTextMeasurement_4( + this, + Invocation.getter(#measurement), + ), + ) as _i6.TextMeasurement); + + @override + _i5.TextDirection get textDirection => (super.noSuchMethod( + Invocation.getter(#textDirection), + returnValue: _i5.TextDirection.ltr, + returnValueForMissingStub: _i5.TextDirection.ltr, + ) as _i5.TextDirection); + + @override + set textDirection(_i5.TextDirection? direction) => super.noSuchMethod( + Invocation.setter( + #textDirection, + direction, + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [TickFormatter]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockNumericTickFormatter extends _i1.Mock + implements _i13.TickFormatter { + @override + List format( + List? tickValues, + Map? cache, { + num? stepSize, + }) => + (super.noSuchMethod( + Invocation.method( + #format, + [ + tickValues, + cache, + ], + {#stepSize: stepSize}, + ), + returnValue: [], + returnValueForMissingStub: [], + ) as List); +} + +/// A class which mocks [BaseTickDrawStrategy]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockDrawStrategy extends _i1.Mock + implements _i14.BaseTickDrawStrategy { + @override + _i7.ChartContext get chartContext => (super.noSuchMethod( + Invocation.getter(#chartContext), + returnValue: _FakeChartContext_5( + this, + Invocation.getter(#chartContext), + ), + returnValueForMissingStub: _FakeChartContext_5( + this, + Invocation.getter(#chartContext), + ), + ) as _i7.ChartContext); + + @override + _i8.GraphicsFactory get graphicsFactory => (super.noSuchMethod( + Invocation.getter(#graphicsFactory), + returnValue: _FakeGraphicsFactory_6( + this, + Invocation.getter(#graphicsFactory), + ), + returnValueForMissingStub: _FakeGraphicsFactory_6( + this, + Invocation.getter(#graphicsFactory), + ), + ) as _i8.GraphicsFactory); + + @override + _i3.LineStyle get axisLineStyle => (super.noSuchMethod( + Invocation.getter(#axisLineStyle), + returnValue: _FakeLineStyle_1( + this, + Invocation.getter(#axisLineStyle), + ), + returnValueForMissingStub: _FakeLineStyle_1( + this, + Invocation.getter(#axisLineStyle), + ), + ) as _i3.LineStyle); + + @override + set axisLineStyle(_i3.LineStyle? _axisLineStyle) => super.noSuchMethod( + Invocation.setter( + #axisLineStyle, + _axisLineStyle, + ), + returnValueForMissingStub: null, + ); + + @override + _i4.TextStyle get labelStyle => (super.noSuchMethod( + Invocation.getter(#labelStyle), + returnValue: _FakeTextStyle_2( + this, + Invocation.getter(#labelStyle), + ), + returnValueForMissingStub: _FakeTextStyle_2( + this, + Invocation.getter(#labelStyle), + ), + ) as _i4.TextStyle); + + @override + set labelStyle(_i4.TextStyle? _labelStyle) => super.noSuchMethod( + Invocation.setter( + #labelStyle, + _labelStyle, + ), + returnValueForMissingStub: null, + ); + + @override + _i15.TickLabelJustification get tickLabelJustification => (super.noSuchMethod( + Invocation.getter(#tickLabelJustification), + returnValue: _i15.TickLabelJustification.inside, + returnValueForMissingStub: _i15.TickLabelJustification.inside, + ) as _i15.TickLabelJustification); + + @override + set tickLabelJustification( + _i15.TickLabelJustification? _tickLabelJustification) => + super.noSuchMethod( + Invocation.setter( + #tickLabelJustification, + _tickLabelJustification, + ), + returnValueForMissingStub: null, + ); + + @override + int get minimumPaddingBetweenLabelsPx => (super.noSuchMethod( + Invocation.getter(#minimumPaddingBetweenLabelsPx), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); + + @override + set minimumPaddingBetweenLabelsPx(int? _minimumPaddingBetweenLabelsPx) => + super.noSuchMethod( + Invocation.setter( + #minimumPaddingBetweenLabelsPx, + _minimumPaddingBetweenLabelsPx, + ), + returnValueForMissingStub: null, + ); + + @override + int labelRotation({required bool? collision}) => (super.noSuchMethod( + Invocation.method( + #labelRotation, + [], + {#collision: collision}, + ), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); + + @override + int labelOffsetFromAxisPx({required bool? collision}) => (super.noSuchMethod( + Invocation.method( + #labelOffsetFromAxisPx, + [], + {#collision: collision}, + ), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); + + @override + int labelOffsetFromTickPx({required bool? collision}) => (super.noSuchMethod( + Invocation.method( + #labelOffsetFromTickPx, + [], + {#collision: collision}, + ), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); + + @override + _i15.TickLabelAnchor tickLabelAnchor({required bool? collision}) => + (super.noSuchMethod( + Invocation.method( + #tickLabelAnchor, + [], + {#collision: collision}, + ), + returnValue: _i15.TickLabelAnchor.before, + returnValueForMissingStub: _i15.TickLabelAnchor.before, + ) as _i15.TickLabelAnchor); + + @override + void decorateTicks(List<_i16.Tick>? ticks) => super.noSuchMethod( + Invocation.method( + #decorateTicks, + [ticks], + ), + returnValueForMissingStub: null, + ); + + @override + void updateTickWidth( + List<_i16.Tick>? ticks, + int? maxWidth, + int? maxHeight, + _i17.AxisOrientation? orientation, { + bool? collision = false, + }) => + super.noSuchMethod( + Invocation.method( + #updateTickWidth, + [ + ticks, + maxWidth, + maxHeight, + orientation, + ], + {#collision: collision}, + ), + returnValueForMissingStub: null, + ); + + @override + _i9.CollisionReport collides( + List<_i16.Tick>? ticks, + _i17.AxisOrientation? orientation, + ) => + (super.noSuchMethod( + Invocation.method( + #collides, + [ + ticks, + orientation, + ], + ), + returnValue: _FakeCollisionReport_7( + this, + Invocation.method( + #collides, + [ + ticks, + orientation, + ], + ), + ), + returnValueForMissingStub: _FakeCollisionReport_7( + this, + Invocation.method( + #collides, + [ + ticks, + orientation, + ], + ), + ), + ) as _i9.CollisionReport); + + @override + _i10.ViewMeasuredSizes measureVerticallyDrawnTicks( + List<_i16.Tick>? ticks, + int? maxWidth, + int? maxHeight, { + bool? collision = false, + }) => + (super.noSuchMethod( + Invocation.method( + #measureVerticallyDrawnTicks, + [ + ticks, + maxWidth, + maxHeight, + ], + {#collision: collision}, + ), + returnValue: _FakeViewMeasuredSizes_8( + this, + Invocation.method( + #measureVerticallyDrawnTicks, + [ + ticks, + maxWidth, + maxHeight, + ], + {#collision: collision}, + ), + ), + returnValueForMissingStub: _FakeViewMeasuredSizes_8( + this, + Invocation.method( + #measureVerticallyDrawnTicks, + [ + ticks, + maxWidth, + maxHeight, + ], + {#collision: collision}, + ), + ), + ) as _i10.ViewMeasuredSizes); + + @override + _i10.ViewMeasuredSizes measureHorizontallyDrawnTicks( + List<_i16.Tick>? ticks, + int? maxWidth, + int? maxHeight, { + bool? collision = false, + }) => + (super.noSuchMethod( + Invocation.method( + #measureHorizontallyDrawnTicks, + [ + ticks, + maxWidth, + maxHeight, + ], + {#collision: collision}, + ), + returnValue: _FakeViewMeasuredSizes_8( + this, + Invocation.method( + #measureHorizontallyDrawnTicks, + [ + ticks, + maxWidth, + maxHeight, + ], + {#collision: collision}, + ), + ), + returnValueForMissingStub: _FakeViewMeasuredSizes_8( + this, + Invocation.method( + #measureHorizontallyDrawnTicks, + [ + ticks, + maxWidth, + maxHeight, + ], + {#collision: collision}, + ), + ), + ) as _i10.ViewMeasuredSizes); + + @override + void drawAxisLine( + _i18.ChartCanvas? canvas, + _i17.AxisOrientation? orientation, + _i19.Rectangle? axisBounds, + ) => + super.noSuchMethod( + Invocation.method( + #drawAxisLine, + [ + canvas, + orientation, + axisBounds, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawLabel( + _i18.ChartCanvas? canvas, + _i16.Tick? tick, { + required _i17.AxisOrientation? orientation, + required _i19.Rectangle? axisBounds, + required _i19.Rectangle? drawAreaBounds, + required bool? isFirst, + required bool? isLast, + bool? collision = false, + }) => + super.noSuchMethod( + Invocation.method( + #drawLabel, + [ + canvas, + tick, + ], + { + #orientation: orientation, + #axisBounds: axisBounds, + #drawAreaBounds: drawAreaBounds, + #isFirst: isFirst, + #isLast: isLast, + #collision: collision, + }, + ), + returnValueForMissingStub: null, + ); + + @override + _i14.PixelVerticalDirection normalizeVerticalAnchor( + _i15.TickLabelAnchor? anchor, + bool? isFirst, + bool? isLast, + ) => + (super.noSuchMethod( + Invocation.method( + #normalizeVerticalAnchor, + [ + anchor, + isFirst, + isLast, + ], + ), + returnValue: _i14.PixelVerticalDirection.over, + returnValueForMissingStub: _i14.PixelVerticalDirection.over, + ) as _i14.PixelVerticalDirection); + + @override + double calculateWidthForRotatedLabel( + int? rotation, + double? labelHeight, + double? labelLength, + ) => + (super.noSuchMethod( + Invocation.method( + #calculateWidthForRotatedLabel, + [ + rotation, + labelHeight, + labelLength, + ], + ), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + + @override + double calculateHeightForRotatedLabel( + int? rotation, + double? labelHeight, + double? labelLength, + ) => + (super.noSuchMethod( + Invocation.method( + #calculateHeightForRotatedLabel, + [ + rotation, + labelHeight, + labelLength, + ], + ), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + + @override + List<_i5.TextElement> splitLabel(_i5.TextElement? wholeLabel) => + (super.noSuchMethod( + Invocation.method( + #splitLabel, + [wholeLabel], + ), + returnValue: <_i5.TextElement>[], + returnValueForMissingStub: <_i5.TextElement>[], + ) as List<_i5.TextElement>); + + @override + double getLabelWidth(Iterable<_i5.TextElement>? labelElements) => + (super.noSuchMethod( + Invocation.method( + #getLabelWidth, + [labelElements], + ), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + + @override + double getLabelHeight(Iterable<_i5.TextElement>? labelElements) => + (super.noSuchMethod( + Invocation.method( + #getLabelHeight, + [labelElements], + ), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + + @override + void draw( + _i18.ChartCanvas? canvas, + _i16.Tick? tick, { + required _i17.AxisOrientation? orientation, + required _i19.Rectangle? axisBounds, + required _i19.Rectangle? drawAreaBounds, + required bool? isFirst, + required bool? isLast, + bool? collision = false, + }) => + super.noSuchMethod( + Invocation.method( + #draw, + [ + canvas, + tick, + ], + { + #orientation: orientation, + #axisBounds: axisBounds, + #drawAreaBounds: drawAreaBounds, + #isFirst: isFirst, + #isLast: isLast, + #collision: collision, + }, + ), + returnValueForMissingStub: null, + ); +}