• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / Famix-UnitTest / 8756162640

19 Apr 2024 03:41PM UTC coverage: 36.187% (-0.7%) from 36.931%
8756162640

push

github

Gabriel-Darbord
Exporter: Rename classes + Configurable AssertJ strategy

29 of 118 new or added lines in 9 files covered. (24.58%)

503 of 1390 relevant lines covered (36.19%)

0.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/Famix-UnitTest-Exporter/FamixUTJUnitJavaAssertionStrategy.class.st
1
Class {
2
        #name : #FamixUTJUnitJavaAssertionStrategy,
3
        #superclass : #FamixUTAbstractJavaAssertionStrategy,
4
        #category : #'Famix-UnitTest-Exporter-Strategies'
5
}
6

7
{ #category : #ast }
NEW
8
FamixUTJUnitJavaAssertionStrategy >> dependencyImportsOn: aFamixUTExporter [
×
9

×
10
        | model |
×
11
        model := aFamixUTExporter model.
×
12
        ^ { (model newImportDeclaration
×
13
                   qualifiedName: (model newQualifiedName name:
×
14
                                            aFamixUTExporter nameOfJUnitPackage , '.'
×
15
                                            , aFamixUTExporter nameOfAssertionsClass);
×
16
                   isStatic: true;
×
17
                   isOnDemand: true) }
×
18
]
×
19

20
{ #category : #exporting }
21
FamixUTJUnitJavaAssertionStrategy >> export: aFamixUTAssertion on: exporter [
1✔
22

1✔
23
        | model actual expected expectedType |
1✔
24
        model := exporter model.
1✔
25
        actual := model newVariableExpression name: 'actual'.
1✔
26
        expected := exporter valueExporter makeVariableExpression:
1✔
27
                            aFamixUTAssertion expected.
1✔
28
        expectedType := aFamixUTAssertion expected type.
1✔
29
        (expectedType isClass and: [ expectedType isPrimitiveWrapper ])
1✔
30
                ifTrue: [ "assertEquals(Integer, int) is ambiguous, need an explicit cast."
1✔
31
                        expected := model newCastExpression
1✔
32
                                            type:
1✔
33
                                                    (expectedType asFASTJavaTypeExpressionOn:
1✔
34
                                                                     exporter valueExporter);
1✔
35
                                            expression: expected ].
1✔
36
        ^ model newExpressionStatement expression:
1✔
37
                  (model newMethodInvocation
1✔
38
                           name: 'assertEquals';
1✔
39
                           addArgument: expected;
1✔
40
                           addArgument: actual;
1✔
41
                           yourself)
1✔
42
]
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc