-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #869 from jecisc/invokedEntity
Add FamixTInvocation>>#invokedEntity
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Class { | ||
#name : #FamixTInvocationTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'invocation' | ||
], | ||
#category : #'Famix-Tests' | ||
} | ||
|
||
{ #category : #running } | ||
FamixTInvocationTest >> setUp [ | ||
|
||
super setUp. | ||
invocation := MooseEntity new | ||
addTalent: FamixTInvocation; | ||
yourself. | ||
|
||
invocation initialize | ||
] | ||
|
||
{ #category : #running } | ||
FamixTInvocationTest >> testInvokedEntity [ | ||
|
||
| function | | ||
function := MooseEntity new | ||
addTalent: FamixTFunction; | ||
initialize; | ||
yourself. | ||
|
||
invocation addCandidate: function. | ||
|
||
self assert: invocation candidates size equals: 1. | ||
self assert: invocation invokedEntity equals: function | ||
] | ||
|
||
{ #category : #running } | ||
FamixTInvocationTest >> testInvokedEntityWithMoreThan1Candidate [ | ||
|
||
| function1 function2 | | ||
function1 := MooseEntity new | ||
addTalent: FamixTFunction; | ||
initialize; | ||
yourself. | ||
|
||
function2 := MooseEntity new | ||
addTalent: FamixTFunction; | ||
initialize; | ||
yourself. | ||
|
||
invocation | ||
addCandidate: function1; | ||
addCandidate: function2. | ||
|
||
self assert: invocation candidates size equals: 2. | ||
self should: [ invocation invokedEntity ] raise: Error | ||
] | ||
|
||
{ #category : #running } | ||
FamixTInvocationTest >> testInvokedEntityWithNoCandidate [ | ||
|
||
self assertEmpty: invocation candidates. | ||
self should: [ invocation invokedEntity ] raise: Error | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters