Skip to content

Commit

Permalink
refactor: renamed the test to make it clear we are writing complex nu…
Browse files Browse the repository at this point in the history
…mbers in cartesian coordinates.
  • Loading branch information
hemalvarambhia committed Jan 16, 2024
1 parent 2e882c9 commit 94e6d49
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Math-Tests-Complex/PMComplexNumberTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,6 @@ PMComplexNumberTest >> testCosh2MinusSinh2 [
self assert: (c cosh squared - c sinh squared) imaginary closeTo: 0.0 ] ]
]

{ #category : #'testing - expressing complex numbers' }
PMComplexNumberTest >> testCreation [
| c |
c := 5 i.
self assert: c real equals: 0.
self assert: c imaginary equals: 5.
c := 6 + 7 i.
self assert: c real equals: 6.
self assert: c imaginary equals: 7.
c := 5.6 - 8 i.
self assert: c real equals: 5.6.
self assert: c imaginary equals: -8.
c := PMComplexNumber real: 10 imaginary: 5.
self assert: c real equals: 10.
self assert: c imaginary equals: 5.
]

{ #category : #'testing - arithmetic' }
PMComplexNumberTest >> testDividingALargeComplexNumbersByItself [
| c1 c2 quotient |
Expand Down Expand Up @@ -937,6 +920,23 @@ PMComplexNumberTest >> testTwoComplexNumbersWithDifferentRealPartsAreNotEqual [
self deny: z equals: w
]

{ #category : #'testing - expressing complex numbers' }
PMComplexNumberTest >> testWritingComplexNumbersInCartesianCoordinates [
| c |
c := 5 i.
self assert: c real equals: 0.
self assert: c imaginary equals: 5.
c := 6 + 7 i.
self assert: c real equals: 6.
self assert: c imaginary equals: 7.
c := 5.6 - 8 i.
self assert: c real equals: 5.6.
self assert: c imaginary equals: -8.
c := PMComplexNumber real: 10 imaginary: 5.
self assert: c real equals: 10.
self assert: c imaginary equals: 5.
]

{ #category : #'testing - expressing complex numbers' }
PMComplexNumberTest >> testWritingComplexNumbersInPolarCoordinates [
| c |
Expand Down

0 comments on commit 94e6d49

Please sign in to comment.