Graphics-Primitives-Tests.st 716 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
!classDefinition: #PointTest category: #'Graphics-Primitives-Tests'!
TestCase subclass: #PointTest
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Graphics-Primitives-Tests'!

!PointTest methodsFor: 'geometry' stamp: 'COD-FCP 6/18/2020 14:13:25'!
test01NotInLine

	self deny: (1@2 isAlongLineFrom: 1@1 to: 2@3).
			
	self deny: (1@2 isAlongLineFrom: 2@2 to: 3@3).! !

!PointTest methodsFor: 'geometry' stamp: 'COD-FCP 6/18/2020 14:15:15'!
test02MiddlePointInLine

	self assert: (2@2 isAlongLineFrom: 1@1 to: 3@3).
			
	self assert: (2@2 isAlongLineFrom: 3@3 to: 1@1).
			
	self assert: (2@2 isAlongLineFrom: 2@1 to: 2@3).
			
	self assert: (2@2 isAlongLineFrom: 1@2 to: 3@2).! !