From ec1974362c1169adac69a3188a77cbae9ec7fe4c Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Tue, 16 Jan 2024 21:34:48 +0000 Subject: [PATCH] refactor: extracted writing complex numbers in polar coordinates to their own tests. --- src/Math-Tests-Complex/PMComplexNumberTest.class.st | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Math-Tests-Complex/PMComplexNumberTest.class.st b/src/Math-Tests-Complex/PMComplexNumberTest.class.st index 787117e2..75247b5b 100644 --- a/src/Math-Tests-Complex/PMComplexNumberTest.class.st +++ b/src/Math-Tests-Complex/PMComplexNumberTest.class.st @@ -323,9 +323,6 @@ PMComplexNumberTest >> testCreation [ c := PMComplexNumber real: 10 imaginary: 5. self assert: c real equals: 10. self assert: c imaginary equals: 5. - c := PMComplexNumber abs: 5 arg: Float pi / 2. - self assert: c real rounded equals: 0. - self assert: c imaginary equals: 5 ] { #category : #'testing - arithmetic' } @@ -940,6 +937,15 @@ PMComplexNumberTest >> testTwoComplexNumbersWithDifferentRealPartsAreNotEqual [ self deny: z equals: w ] +{ #category : #'testing - expressing complex numbers' } +PMComplexNumberTest >> testWritingComplexNumbersInRadialCoordinates [ + | c | + + c := PMComplexNumber abs: 5 arg: Float pi / 2. + self assert: c real rounded equals: 0. + self assert: c imaginary equals: 5 +] + { #category : #'testing - expressing complex numbers' } PMComplexNumberTest >> testWritingComplexNumbersWhoseRealAndImaginaryPartsAreFractions [ | z |