Skip to content

Commit 5dc6e67

Browse files
Illia Romanenkosolid-software-hq
andauthored
Remove long-method & source-lines-of-code for tests (#6)
* fix typo * Fix no empty line Co-authored-by: Solid Software <[email protected]>
1 parent c3bcb7d commit 5dc6e67

File tree

5 files changed

+386
-7
lines changed

5 files changed

+386
-7
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
void main() {
2-
tooManyParams(1, 2, 3, 4, 5);
2+
sum(1, 1);
33
}
44

5-
/// Documentation
6-
///
7-
int tooManyParams(int p1, int p2, int p3, int p4, int p5) =>
8-
p1 + p2 + p3 + p4 + p5;
5+
/// Sum of two numbers. Standard dart overflow rules apply.
6+
int sum(int p1, int p2) => p1 + p2;

example/pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ dev_dependencies:
99
dart_code_metrics: ^4.8.0
1010
solid_lints:
1111
path: ../
12-
13-
12+
test: ^1.20.1
1413

example/test/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:solid_lints/analysis_options_test.yaml
Lines changed: 368 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,368 @@
1+
import 'package:solid_lints_example/solid_lints_example.dart';
2+
import 'package:test/test.dart';
3+
4+
class Service {
5+
int method() {
6+
return 0;
7+
}
8+
}
9+
10+
class ServiceStub implements Service {
11+
@override
12+
int method() {
13+
return 1;
14+
}
15+
}
16+
17+
void main() {
18+
//It's handy to use `late` in such situations.
19+
late Service service;
20+
setUp(() {
21+
service = ServiceStub();
22+
});
23+
24+
//intentionally long test method to test for long-method rule
25+
const two = 2;
26+
test("addition", () {
27+
expect(sum(1, service.method()), equals(two));
28+
});
29+
test("addition", () {
30+
expect(sum(1, service.method()), equals(two));
31+
});
32+
test("addition", () {
33+
expect(sum(1, service.method()), equals(two));
34+
});
35+
test("addition", () {
36+
expect(sum(1, service.method()), equals(two));
37+
});
38+
test("addition", () {
39+
expect(sum(1, service.method()), equals(two));
40+
});
41+
test("addition", () {
42+
expect(sum(1, service.method()), equals(two));
43+
});
44+
test("addition", () {
45+
expect(sum(1, service.method()), equals(two));
46+
});
47+
test("addition", () {
48+
expect(sum(1, service.method()), equals(two));
49+
});
50+
test("addition", () {
51+
expect(sum(1, service.method()), equals(two));
52+
});
53+
test("addition", () {
54+
expect(sum(1, service.method()), equals(two));
55+
});
56+
test("addition", () {
57+
expect(sum(1, service.method()), equals(two));
58+
});
59+
test("addition", () {
60+
expect(sum(1, service.method()), equals(two));
61+
});
62+
test("addition", () {
63+
expect(sum(1, service.method()), equals(two));
64+
});
65+
test("addition", () {
66+
expect(sum(1, service.method()), equals(two));
67+
});
68+
test("addition", () {
69+
expect(sum(1, service.method()), equals(two));
70+
});
71+
test("addition", () {
72+
expect(sum(1, service.method()), equals(two));
73+
});
74+
test("addition", () {
75+
expect(sum(1, service.method()), equals(two));
76+
});
77+
test("addition", () {
78+
expect(sum(1, service.method()), equals(two));
79+
});
80+
test("addition", () {
81+
expect(sum(1, service.method()), equals(two));
82+
});
83+
test("addition", () {
84+
expect(sum(1, service.method()), equals(two));
85+
});
86+
test("addition", () {
87+
expect(sum(1, service.method()), equals(two));
88+
});
89+
test("addition", () {
90+
expect(sum(1, service.method()), equals(two));
91+
});
92+
test("addition", () {
93+
expect(sum(1, service.method()), equals(two));
94+
});
95+
test("addition", () {
96+
expect(sum(1, service.method()), equals(two));
97+
});
98+
test("addition", () {
99+
expect(sum(1, service.method()), equals(two));
100+
});
101+
test("addition", () {
102+
expect(sum(1, service.method()), equals(two));
103+
});
104+
test("addition", () {
105+
expect(sum(1, service.method()), equals(two));
106+
});
107+
test("addition", () {
108+
expect(sum(1, service.method()), equals(two));
109+
});
110+
test("addition", () {
111+
expect(sum(1, service.method()), equals(two));
112+
});
113+
test("addition", () {
114+
expect(sum(1, service.method()), equals(two));
115+
});
116+
test("addition", () {
117+
expect(sum(1, service.method()), equals(two));
118+
});
119+
test("addition", () {
120+
expect(sum(1, service.method()), equals(two));
121+
});
122+
test("addition", () {
123+
expect(sum(1, service.method()), equals(two));
124+
});
125+
test("addition", () {
126+
expect(sum(1, service.method()), equals(two));
127+
});
128+
test("addition", () {
129+
expect(sum(1, service.method()), equals(two));
130+
});
131+
test("addition", () {
132+
expect(sum(1, service.method()), equals(two));
133+
});
134+
test("addition", () {
135+
expect(sum(1, service.method()), equals(two));
136+
});
137+
test("addition", () {
138+
expect(sum(1, service.method()), equals(two));
139+
});
140+
test("addition", () {
141+
expect(sum(1, service.method()), equals(two));
142+
});
143+
test("addition", () {
144+
expect(sum(1, service.method()), equals(two));
145+
});
146+
test("addition", () {
147+
expect(sum(1, service.method()), equals(two));
148+
});
149+
test("addition", () {
150+
expect(sum(1, service.method()), equals(two));
151+
});
152+
test("addition", () {
153+
expect(sum(1, service.method()), equals(two));
154+
});
155+
test("addition", () {
156+
expect(sum(1, service.method()), equals(two));
157+
});
158+
test("addition", () {
159+
expect(sum(1, service.method()), equals(two));
160+
});
161+
test("addition", () {
162+
expect(sum(1, service.method()), equals(two));
163+
});
164+
test("addition", () {
165+
expect(sum(1, service.method()), equals(two));
166+
});
167+
test("addition", () {
168+
expect(sum(1, service.method()), equals(two));
169+
});
170+
test("addition", () {
171+
expect(sum(1, service.method()), equals(two));
172+
});
173+
test("addition", () {
174+
expect(sum(1, service.method()), equals(two));
175+
});
176+
test("addition", () {
177+
expect(sum(1, service.method()), equals(two));
178+
});
179+
test("addition", () {
180+
expect(sum(1, service.method()), equals(two));
181+
});
182+
test("addition", () {
183+
expect(sum(1, service.method()), equals(two));
184+
});
185+
test("addition", () {
186+
expect(sum(1, service.method()), equals(two));
187+
});
188+
test("addition", () {
189+
expect(sum(1, service.method()), equals(two));
190+
});
191+
test("addition", () {
192+
expect(sum(1, service.method()), equals(two));
193+
});
194+
test("addition", () {
195+
expect(sum(1, service.method()), equals(two));
196+
});
197+
test("addition", () {
198+
expect(sum(1, service.method()), equals(two));
199+
});
200+
test("addition", () {
201+
expect(sum(1, service.method()), equals(two));
202+
});
203+
test("addition", () {
204+
expect(sum(1, service.method()), equals(two));
205+
});
206+
test("addition", () {
207+
expect(sum(1, service.method()), equals(two));
208+
});
209+
test("addition", () {
210+
expect(sum(1, service.method()), equals(two));
211+
});
212+
test("addition", () {
213+
expect(sum(1, service.method()), equals(two));
214+
});
215+
test("addition", () {
216+
expect(sum(1, service.method()), equals(two));
217+
});
218+
test("addition", () {
219+
expect(sum(1, service.method()), equals(two));
220+
});
221+
test("addition", () {
222+
expect(sum(1, service.method()), equals(two));
223+
});
224+
test("addition", () {
225+
expect(sum(1, service.method()), equals(two));
226+
});
227+
test("addition", () {
228+
expect(sum(1, service.method()), equals(two));
229+
});
230+
test("addition", () {
231+
expect(sum(1, service.method()), equals(two));
232+
});
233+
test("addition", () {
234+
expect(sum(1, service.method()), equals(two));
235+
});
236+
test("addition", () {
237+
expect(sum(1, service.method()), equals(two));
238+
});
239+
test("addition", () {
240+
expect(sum(1, service.method()), equals(two));
241+
});
242+
test("addition", () {
243+
expect(sum(1, service.method()), equals(two));
244+
});
245+
test("addition", () {
246+
expect(sum(1, service.method()), equals(two));
247+
});
248+
test("addition", () {
249+
expect(sum(1, service.method()), equals(two));
250+
});
251+
test("addition", () {
252+
expect(sum(1, service.method()), equals(two));
253+
});
254+
test("addition", () {
255+
expect(sum(1, service.method()), equals(two));
256+
});
257+
test("addition", () {
258+
expect(sum(1, service.method()), equals(two));
259+
});
260+
test("addition", () {
261+
expect(sum(1, service.method()), equals(two));
262+
});
263+
test("addition", () {
264+
expect(sum(1, service.method()), equals(two));
265+
});
266+
test("addition", () {
267+
expect(sum(1, service.method()), equals(two));
268+
});
269+
test("addition", () {
270+
expect(sum(1, service.method()), equals(two));
271+
});
272+
test("addition", () {
273+
expect(sum(1, service.method()), equals(two));
274+
});
275+
test("addition", () {
276+
expect(sum(1, service.method()), equals(two));
277+
});
278+
test("addition", () {
279+
expect(sum(1, service.method()), equals(two));
280+
});
281+
test("addition", () {
282+
expect(sum(1, service.method()), equals(two));
283+
});
284+
test("addition", () {
285+
expect(sum(1, service.method()), equals(two));
286+
});
287+
test("addition", () {
288+
expect(sum(1, service.method()), equals(two));
289+
});
290+
test("addition", () {
291+
expect(sum(1, service.method()), equals(two));
292+
});
293+
test("addition", () {
294+
expect(sum(1, service.method()), equals(two));
295+
});
296+
test("addition", () {
297+
expect(sum(1, service.method()), equals(two));
298+
});
299+
test("addition", () {
300+
expect(sum(1, service.method()), equals(two));
301+
});
302+
test("addition", () {
303+
expect(sum(1, service.method()), equals(two));
304+
});
305+
test("addition", () {
306+
expect(sum(1, service.method()), equals(two));
307+
});
308+
test("addition", () {
309+
expect(sum(1, service.method()), equals(two));
310+
});
311+
test("addition", () {
312+
expect(sum(1, service.method()), equals(two));
313+
});
314+
test("addition", () {
315+
expect(sum(1, service.method()), equals(two));
316+
});
317+
test("addition", () {
318+
expect(sum(1, service.method()), equals(two));
319+
});
320+
test("addition", () {
321+
expect(sum(1, service.method()), equals(two));
322+
});
323+
test("addition", () {
324+
expect(sum(1, service.method()), equals(two));
325+
});
326+
test("addition", () {
327+
expect(sum(1, service.method()), equals(two));
328+
});
329+
test("addition", () {
330+
expect(sum(1, service.method()), equals(two));
331+
});
332+
test("addition", () {
333+
expect(sum(1, service.method()), equals(two));
334+
});
335+
test("addition", () {
336+
expect(sum(1, service.method()), equals(two));
337+
});
338+
test("addition", () {
339+
expect(sum(1, service.method()), equals(two));
340+
});
341+
test("addition", () {
342+
expect(sum(1, service.method()), equals(two));
343+
});
344+
test("addition", () {
345+
expect(sum(1, service.method()), equals(two));
346+
});
347+
test("addition", () {
348+
expect(sum(1, service.method()), equals(two));
349+
});
350+
test("addition", () {
351+
expect(sum(1, service.method()), equals(two));
352+
});
353+
test("addition", () {
354+
expect(sum(1, service.method()), equals(two));
355+
});
356+
test("addition", () {
357+
expect(sum(1, service.method()), equals(two));
358+
});
359+
test("addition", () {
360+
expect(sum(1, service.method()), equals(two));
361+
});
362+
test("addition", () {
363+
expect(sum(1, service.method()), equals(two));
364+
});
365+
test("addition", () {
366+
expect(sum(1, service.method()), equals(two));
367+
});
368+
}

0 commit comments

Comments
 (0)