Skip to content

Fix the tests including a property change for the number of methods #50

@AntoninGoslin

Description

@AntoninGoslin

Some tests methods are now red with the use of moose models. For exemple this one:

testCompareEntityToReturnsFalseWhenSameClassesAndAMethodIsAdded
	| sd class1 class2 method1 method2 method3 model1 model2 diff |
	sd := FamixSimpleDiff new.

	"we need to create a model to contain our entities"
	model1 := FamixJavaModel new.
	model2 := FamixJavaModel new.	
	
	"same classes"
	class1 := FamixJavaClass new name: 'MyClass'.
	class2 := FamixJavaClass new name: 'MyClass'.
	
	"same methods"
	method1 := FamixJavaMethod new name: 'myMethod'.
	method1 signature: 'myMethod()'.
	method2 := FamixJavaMethod new name: 'myMethod'.
	method2 signature: 'myMethod()'.
	method3 := FamixJavaMethod new name: 'newMethod'.
	method3 signature: 'newMethod()'.
		
	class1 methods: { method1 }.
	class2 methods: { method2 . method3 }.
	
	model1 add: class1.
	model2 add: class2.
	
	self deny: (sd compareEntity: class1 to: class2).
	self assert: sd differences size equals: 1.
		
	diff := sd differences first.
	
	self assert: diff class equals: FamixSimpleDifferenceEntityAddition.
	self assert: diff expectedValue class equals: FamixSimpleDifferenceNullValue.
	self assert: diff actualValue name equals: 'newMethod'.

Thanks to Moose models, we are now detecting some properties like numberOfMethods
This is an interesting property that must be included in the diffference list, so the test have to be change to consider this kind of properties

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions