From 6ea3c6c3ecb2af0b8c484b259256395a5d2c1d9a Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 12:23:28 +0200 Subject: [PATCH 01/19] Object ComplexNumber created --- .../ugsbo/complexnumcalc/ComplexNumber.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java new file mode 100644 index 0000000..dab8117 --- /dev/null +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -0,0 +1,45 @@ +package com.ugsbo.complexnumcalc; + +public class ComplexNumber { + private int realPart; + private int imaginaryPart; + + /** + * @param realPart The real part of the complex Number + * @param imaginaryPart The imaginary part of the complex Number + */ + + public ComplexNumber(int realPart, int imaginaryPart) { + this.realPart = realPart; + this.imaginaryPart = imaginaryPart; + } + + /** + * @return the realPart + */ + public int getRealPart() { + return realPart; + } + + /** + * @param realPart the realPart to set + */ + public void setRealPart(int realPart) { + this.realPart = realPart; + } + + /** + * @return the imaginaryPart + */ + public int getImaginaryPart() { + return imaginaryPart; + } + + /** + * @param imaginaryPart the imaginaryPart to set + */ + public void setImaginaryPart(int imaginaryPart) { + this.imaginaryPart = imaginaryPart; + } + +} \ No newline at end of file From 793c47bad12ae5d9521ce28f48c15f6d68ee4c52 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 15:10:08 +0200 Subject: [PATCH 02/19] Added equal function to the ComplexNumber Object --- .../ugsbo/complexnumcalc/ComplexNumber.java | 34 ++++++--- .../EqualsComplexNumversTest.java | 69 +++++++++++++++++++ 2 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumversTest.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index dab8117..3eb2db5 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -1,15 +1,15 @@ package com.ugsbo.complexnumcalc; public class ComplexNumber { - private int realPart; - private int imaginaryPart; + private Double realPart; + private Double imaginaryPart; /** - * @param realPart The real part of the complex Number + * @param realPart The real part of the complex Number * @param imaginaryPart The imaginary part of the complex Number */ - public ComplexNumber(int realPart, int imaginaryPart) { + public ComplexNumber(Double realPart, Double imaginaryPart) { this.realPart = realPart; this.imaginaryPart = imaginaryPart; } @@ -17,29 +17,43 @@ public class ComplexNumber { /** * @return the realPart */ - public int getRealPart() { + public Double getRealPart() { return realPart; } /** * @param realPart the realPart to set */ - public void setRealPart(int realPart) { + public void setRealPart(Double realPart) { this.realPart = realPart; } /** * @return the imaginaryPart */ - public int getImaginaryPart() { + public Double getImaginaryPart() { return imaginaryPart; } /** * @param imaginaryPart the imaginaryPart to set */ - public void setImaginaryPart(int imaginaryPart) { + public void setImaginaryPart(Double imaginaryPart) { this.imaginaryPart = imaginaryPart; - } - + } + + /** + * Checks if the given complex Number is equal to this object. + * + * @param complexNumber The number wich gets compared with this Instance + * @return True if the complex Numbers are Equal + */ + public boolean equals(ComplexNumber complexNumber) { + if (this.realPart.equals(complexNumber.realPart) && this.imaginaryPart.equals(complexNumber.imaginaryPart)) { + return true; + } else { + return false; + } + } + } \ No newline at end of file diff --git a/src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumversTest.java b/src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumversTest.java new file mode 100644 index 0000000..16a02c8 --- /dev/null +++ b/src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumversTest.java @@ -0,0 +1,69 @@ +package com.ugsbo.complexnumcalc; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class EqualsComplexNumversTest { + + @Test + public void TwoEqualNumbersWithOnlyRealPart_AreNotDetectedAsEqual() { + ComplexNumber firstNumber = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); + ComplexNumber secoundNumber = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); + + boolean actual = firstNumber.equals(secoundNumber); + + assertTrue("TwoEqualNumbersShouldBeEqual", actual); + } + + @Test + public void TwoNotEqualNumbersWithOnlyRealPart_AreDetectedAsEqual() { + ComplexNumber firstNumber = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); + ComplexNumber secoundNumber = new ComplexNumber(Double.valueOf(6), Double.valueOf(0)); + + boolean actual = firstNumber.equals(secoundNumber); + + assertFalse("TwoNotEqualNumbersShouldNotBeEqual", actual); + } + + @Test + public void TwoEqualNumbersWithOnlyImaginaryPart_AreNotDetectedAsEqual() { + ComplexNumber firstNumber = new ComplexNumber(Double.valueOf(0), Double.valueOf(5)); + ComplexNumber secoundNumber = new ComplexNumber(Double.valueOf(0), Double.valueOf(5)); + + boolean actual = firstNumber.equals(secoundNumber); + + assertTrue("TwoEqualComplexNumbersShouldBeEqual", actual); + } + + @Test + public void TwoNotEqualNumbersWithOnlyImaginaryPart_AreDetectedAsEqual() { + ComplexNumber firstNumber = new ComplexNumber(Double.valueOf(0), Double.valueOf(5)); + ComplexNumber secoundNumber = new ComplexNumber(Double.valueOf(0), Double.valueOf(6)); + + boolean actual = firstNumber.equals(secoundNumber); + + assertFalse("TwoNotEqualComplexNumbersShouldNotBeEqual", actual); + } + + @Test + public void TwoEqualComplexNumbers_AreNotDetectedAsEqual() { + ComplexNumber firstNumber = new ComplexNumber(Double.valueOf(5), Double.valueOf(5)); + ComplexNumber secoundNumber = new ComplexNumber(Double.valueOf(5), Double.valueOf(5)); + + boolean actual = firstNumber.equals(secoundNumber); + + assertTrue("TwoEqualComplexNumbersShouldBeEqual", actual); + } + + @Test + public void TwoNotEqualComplexNumbers_AreDetectedAsEqual() { + ComplexNumber firstNumber = new ComplexNumber(Double.valueOf(5), Double.valueOf(5)); + ComplexNumber secoundNumber = new ComplexNumber(Double.valueOf(6), Double.valueOf(6)); + + boolean actual = firstNumber.equals(secoundNumber); + + assertFalse("TwoNotEqualComplexNumbersShouldNotBeEqual", actual); + } +} \ No newline at end of file From 24da1c0969968d17cb8381c002711c538e5276e1 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 15:23:42 +0200 Subject: [PATCH 03/19] Added add function to the ComplexNumber Object --- .../ugsbo/complexnumcalc/ComplexNumber.java | 18 +++++++++++ .../complexnumcalc/AddComplexNumbersTest.java | 30 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index 3eb2db5..7350d89 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -56,4 +56,22 @@ public class ComplexNumber { } } + /** + * Adds two complex Numbers together. + * + * @param addend The complex Number. + * @return The result of adding the two complex Numbers together, as a conplex + * Number. + */ + public ComplexNumber add(ComplexNumber addend) { + Double sumRealPart, sumImaginaryPart; + + sumRealPart = this.realPart + addend.realPart; + sumImaginaryPart = this.imaginaryPart + addend.imaginaryPart; + + ComplexNumber sum = new ComplexNumber(sumRealPart, sumImaginaryPart); + + return sum; + } + } \ No newline at end of file diff --git a/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java new file mode 100644 index 0000000..4c1d395 --- /dev/null +++ b/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java @@ -0,0 +1,30 @@ +package com.ugsbo.complexnumcalc; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class AddComplexNumbersTest { + + @Test + public void addingTwoComplexNumbersWithoutImaginaryPart() { + ComplexNumber firstAddend = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); + ComplexNumber SecoundAddend = new ComplexNumber(Double.valueOf(6), Double.valueOf(0)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(11), Double.valueOf(0)); + + ComplexNumber sum = firstAddend.add(SecoundAddend); + + assertTrue("Dont sum to the sum", sum.equals(expected)); + } + + @Test + public void addingTwoComplexNumbersWithImaginaryPart() { + ComplexNumber firstAddend = new ComplexNumber(Double.valueOf(5), Double.valueOf(3)); + ComplexNumber SecoundAddend = new ComplexNumber(Double.valueOf(6), Double.valueOf(4)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(11), Double.valueOf(7)); + + ComplexNumber sum = firstAddend.add(SecoundAddend); + + assertTrue("Dont sum to the sum", sum.equals(expected)); + } +} \ No newline at end of file From 8252779c8f4184183e006701945a5427fe50b27f Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 15:40:06 +0200 Subject: [PATCH 04/19] Correct a Typo and added substract function to the ComplexNumber Object --- .../ugsbo/complexnumcalc/ComplexNumber.java | 17 +++++++++++ .../complexnumcalc/AddComplexNumbersTest.java | 8 ++--- .../SubstractComplexNumbersTest.java | 30 +++++++++++++++++++ 3 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index 7350d89..3d35f8d 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -74,4 +74,21 @@ public class ComplexNumber { return sum; } + /** + * Substracts the Subtrahend form this instance. + * + * @param subtrahend The Number wich will be substracted form the Minuend + * @return The Differenz of the Minuend and Subtrahend. + */ + public ComplexNumber substract(ComplexNumber subtrahend) { + Double differenzRealPart, differenzImaginaryPart; + + differenzRealPart = this.realPart - subtrahend.realPart; + differenzImaginaryPart = this.imaginaryPart - subtrahend.imaginaryPart; + + ComplexNumber differenz = new ComplexNumber(differenzRealPart, differenzImaginaryPart); + + return differenz; + } + } \ No newline at end of file diff --git a/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java index 4c1d395..644406f 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java @@ -9,10 +9,10 @@ public class AddComplexNumbersTest { @Test public void addingTwoComplexNumbersWithoutImaginaryPart() { ComplexNumber firstAddend = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); - ComplexNumber SecoundAddend = new ComplexNumber(Double.valueOf(6), Double.valueOf(0)); + ComplexNumber secoundAddend = new ComplexNumber(Double.valueOf(6), Double.valueOf(0)); ComplexNumber expected = new ComplexNumber(Double.valueOf(11), Double.valueOf(0)); - ComplexNumber sum = firstAddend.add(SecoundAddend); + ComplexNumber sum = firstAddend.add(secoundAddend); assertTrue("Dont sum to the sum", sum.equals(expected)); } @@ -20,10 +20,10 @@ public class AddComplexNumbersTest { @Test public void addingTwoComplexNumbersWithImaginaryPart() { ComplexNumber firstAddend = new ComplexNumber(Double.valueOf(5), Double.valueOf(3)); - ComplexNumber SecoundAddend = new ComplexNumber(Double.valueOf(6), Double.valueOf(4)); + ComplexNumber secoundAddend = new ComplexNumber(Double.valueOf(6), Double.valueOf(4)); ComplexNumber expected = new ComplexNumber(Double.valueOf(11), Double.valueOf(7)); - ComplexNumber sum = firstAddend.add(SecoundAddend); + ComplexNumber sum = firstAddend.add(secoundAddend); assertTrue("Dont sum to the sum", sum.equals(expected)); } diff --git a/src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java new file mode 100644 index 0000000..cc42978 --- /dev/null +++ b/src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java @@ -0,0 +1,30 @@ +package com.ugsbo.complexnumcalc; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class SubstractComplexNumbersTest { + + @Test + public void substractTwoComplexNumbersWithoutImaginaryPart() { + ComplexNumber minuend = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); + ComplexNumber subtrahend = new ComplexNumber(Double.valueOf(6), Double.valueOf(0)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(-1), Double.valueOf(0)); + + ComplexNumber difference = minuend.substract(subtrahend); + + assertTrue("The difference is not as expected", difference.equals(expected)); + } + + @Test + public void substractTwoComplexNumbersWithImaginaryPart() { + ComplexNumber minuend = new ComplexNumber(Double.valueOf(5), Double.valueOf(5)); + ComplexNumber subtrahend = new ComplexNumber(Double.valueOf(6), Double.valueOf(4)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(-1), Double.valueOf(1)); + + ComplexNumber difference = minuend.substract(subtrahend); + + assertTrue("The difference is not as expected", difference.equals(expected)); + } +} \ No newline at end of file From ac21b68eacc1073e3601f11b5e5b6addb6663ef3 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 16:09:02 +0200 Subject: [PATCH 05/19] Added the multiply functionality for ComplexNumbers it can multiply ComplexNumbers without an Imaginary part --- .../ugsbo/complexnumcalc/ComplexNumber.java | 17 +++++++++++++++++ .../MultiplyComplexNumbersTest.java | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index 3d35f8d..37e9a0c 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -91,4 +91,21 @@ public class ComplexNumber { return differenz; } + /** + * Multiplies the faktor with this Instance. + * + * @param faktor The ComplexNumber by wich this Instance will get multiplyed + * @return The product of this Instance and the faktor + */ + public ComplexNumber multiply(ComplexNumber faktor) { + Double productRealPart, productImaginaryPart; + + productRealPart = this.realPart * faktor.realPart + this.imaginaryPart * faktor.imaginaryPart * -1.0; + productImaginaryPart = 0.0; + + ComplexNumber product = new ComplexNumber(productRealPart, productImaginaryPart); + + return product; + } + } \ No newline at end of file diff --git a/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java new file mode 100644 index 0000000..58ae87b --- /dev/null +++ b/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java @@ -0,0 +1,19 @@ +package com.ugsbo.complexnumcalc; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class MultiplyComplexNumbersTest { + + @Test + public void multiplyTwoComplexNumbersWithoutImaginaryPart() { + ComplexNumber firstFaktor = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); + ComplexNumber secoundFaktor = new ComplexNumber(Double.valueOf(6), Double.valueOf(0)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(30), Double.valueOf(0)); + + ComplexNumber product = firstFaktor.multiply(secoundFaktor); + + assertTrue("The product is not as expected", product.equals(expected)); + } +} \ No newline at end of file From db1c0d25a01dd6a3023bf8e13ed60d7e6bbdeffb Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 16:30:37 +0200 Subject: [PATCH 06/19] added multiplying two ComplexNumbers with imaginary parts --- .../java/com/ugsbo/complexnumcalc/ComplexNumber.java | 4 ++-- .../complexnumcalc/MultiplyComplexNumbersTest.java | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index 37e9a0c..cbb6331 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -100,8 +100,8 @@ public class ComplexNumber { public ComplexNumber multiply(ComplexNumber faktor) { Double productRealPart, productImaginaryPart; - productRealPart = this.realPart * faktor.realPart + this.imaginaryPart * faktor.imaginaryPart * -1.0; - productImaginaryPart = 0.0; + productRealPart = this.realPart * faktor.realPart - this.imaginaryPart * faktor.imaginaryPart; + productImaginaryPart = this.realPart * faktor.imaginaryPart + this.imaginaryPart * faktor.realPart; ComplexNumber product = new ComplexNumber(productRealPart, productImaginaryPart); diff --git a/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java index 58ae87b..92f007c 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java @@ -16,4 +16,15 @@ public class MultiplyComplexNumbersTest { assertTrue("The product is not as expected", product.equals(expected)); } + + @Test + public void multiplyTwoComplexNumbersWithImaginaryPart() { + ComplexNumber firstFaktor = new ComplexNumber(Double.valueOf(5), Double.valueOf(3)); + ComplexNumber secoundFaktor = new ComplexNumber(Double.valueOf(6), Double.valueOf(2)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(24.0), Double.valueOf(28.0)); + + ComplexNumber product = firstFaktor.multiply(secoundFaktor); + + assertTrue("The product is not as expected", product.equals(expected)); + } } \ No newline at end of file From 6757bfe86dd907d929b7409ad45344c53d524034 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 17:04:53 +0200 Subject: [PATCH 07/19] added division of ComplexNumbers to the ComplexNumber Object. --- .../ugsbo/complexnumcalc/ComplexNumber.java | 20 +++++++++++++ .../DivideComplexNumbersTest.java | 30 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index cbb6331..3f50272 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -108,4 +108,24 @@ public class ComplexNumber { return product; } + /** + * Divides the dividend by the divisor, the dividend is this Instance. + * + * @param divisor The ComplexNumber by wich this Instance will get divided + * @return The Qoutient of the Instance and the divisor + */ + public ComplexNumber divide(ComplexNumber divisor) { + Double qoutientRealPart, qoutientImaginaryPart, tempDivisor; + + tempDivisor = divisor.realPart * divisor.realPart + divisor.imaginaryPart * divisor.imaginaryPart; + qoutientRealPart = this.realPart * divisor.realPart + this.imaginaryPart * divisor.imaginaryPart; + qoutientImaginaryPart = this.imaginaryPart * divisor.realPart - this.realPart * divisor.imaginaryPart; + qoutientImaginaryPart /= tempDivisor; + qoutientRealPart /= tempDivisor; + + ComplexNumber qoutient = new ComplexNumber(qoutientRealPart, qoutientImaginaryPart); + + return qoutient; + } + } \ No newline at end of file diff --git a/src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java new file mode 100644 index 0000000..fd0e2e4 --- /dev/null +++ b/src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java @@ -0,0 +1,30 @@ +package com.ugsbo.complexnumcalc; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class DivideComplexNumbersTest { + + @Test + public void divideTwoComplexNumbersWithoutImaginaryPart() { + ComplexNumber dividend = new ComplexNumber(Double.valueOf(30), Double.valueOf(0)); + ComplexNumber divisor = new ComplexNumber(Double.valueOf(6), Double.valueOf(0)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(5), Double.valueOf(0)); + + ComplexNumber quotient = dividend.divide(divisor); + + assertTrue("The quotient is not as expected", quotient.equals(expected)); + } + + @Test + public void divideTwoComplexNumbersWithImaginaryPart() { + ComplexNumber dividend = new ComplexNumber(Double.valueOf(30), Double.valueOf(28)); + ComplexNumber divisor = new ComplexNumber(Double.valueOf(6), Double.valueOf(2)); + ComplexNumber expected = new ComplexNumber(Double.valueOf(5.9), Double.valueOf(2.7)); + + ComplexNumber quotient = dividend.divide(divisor); + + assertTrue("The quotient is not as expected", quotient.equals(expected)); + } +} \ No newline at end of file From eef6b9ee6e908cdbe9faa06b086358ffbc329153 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 18:00:49 +0200 Subject: [PATCH 08/19] The absolute value of an complex Number with only a real part can is now implemented in the absolutValueOf function --- .../ugsbo/complexnumcalc/ComplexNumber.java | 5 ++++ .../AbsoluteValueOfComplexNumbersTest.java | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index 3f50272..90769e5 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -128,4 +128,9 @@ public class ComplexNumber { return qoutient; } + public Double absolutValueOf(){ + Double absoluteValue = Math.sqrt(Math.pow(this.realPart, 2)) ; + return absoluteValue; + } + } \ No newline at end of file diff --git a/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java new file mode 100644 index 0000000..be70ff6 --- /dev/null +++ b/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java @@ -0,0 +1,29 @@ +package com.ugsbo.complexnumcalc; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class AbsoluteValueOfComplexNumbersTest { + + @Test + public void TheAbsoluteValueOfAComplexNumberWithOnlyARealPart_IsNotTHeAbsoluteValueOfTheRealPart() { + ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(4), Double.valueOf(0)); + + Double expected = Double.valueOf(4); + + Double actual = complexNumber.absolutValueOf(); + + assertEquals("The absolute value of an complex number with only an real part should be the absolute value of that real part", expected, actual); + } + + @Test + public void TheAbsoluteValueOfAComplexNumberWithOnlyANegativeRealPart_IsNotTheAbsoluteValueOfTheRealPart() { + ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(-4), Double.valueOf(0)); + + Double expected = Double.valueOf(4); + + Double actual = complexNumber.absolutValueOf(); + + assertEquals("The absolute value of an complex number with only an negative real part should be the absolute value of that real part", expected, actual); + } +} \ No newline at end of file From 4f3f9399a8b321643b876f54e17ffb0f27a0655b Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 18:09:06 +0200 Subject: [PATCH 09/19] Added the functionality to calculate the absolute value of an complex number --- .../ugsbo/complexnumcalc/ComplexNumber.java | 2 +- .../AbsoluteValueOfComplexNumbersTest.java | 46 ++++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index 90769e5..b55cc87 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -129,7 +129,7 @@ public class ComplexNumber { } public Double absolutValueOf(){ - Double absoluteValue = Math.sqrt(Math.pow(this.realPart, 2)) ; + Double absoluteValue = Math.sqrt(Math.pow(this.realPart, 2) + Math.pow(this.imaginaryPart, 2)) ; return absoluteValue; } diff --git a/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java index be70ff6..48a3d70 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java @@ -8,7 +8,6 @@ public class AbsoluteValueOfComplexNumbersTest { @Test public void TheAbsoluteValueOfAComplexNumberWithOnlyARealPart_IsNotTHeAbsoluteValueOfTheRealPart() { ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(4), Double.valueOf(0)); - Double expected = Double.valueOf(4); Double actual = complexNumber.absolutValueOf(); @@ -19,11 +18,54 @@ public class AbsoluteValueOfComplexNumbersTest { @Test public void TheAbsoluteValueOfAComplexNumberWithOnlyANegativeRealPart_IsNotTheAbsoluteValueOfTheRealPart() { ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(-4), Double.valueOf(0)); - Double expected = Double.valueOf(4); Double actual = complexNumber.absolutValueOf(); assertEquals("The absolute value of an complex number with only an negative real part should be the absolute value of that real part", expected, actual); } + + @Test + public void TheAbsoluteValueOfAComplexNumber_IsNotTheAbsoluteValueOfIt() { + ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(4), Double.valueOf(3)); + Double expected = Double.valueOf(5); + + Double actual = complexNumber.absolutValueOf(); + + assertEquals("The absolute value of an complex number should be the square root of the sum of real " + + "part times real part and imaginary part times imaginary part ", expected, actual); + } + + @Test + public void TheAbsoluteValueOfAComplexNumberWithNegativRealPart_IsNotTheAbsoluteValueOfIt() { + ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(-4), Double.valueOf(3)); + Double expected = Double.valueOf(5); + + Double actual = complexNumber.absolutValueOf(); + + assertEquals("The absolute value of an complex number with negative real part should be the square root of the sum of real " + + "part times real part and imaginary part times imaginary part ", expected, actual); + } + + @Test + public void TheAbsoluteValueOfAComplexNumberWithNegativImaginaryPart_IsNotTheAbsoluteValueOfIt() { + ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(4), Double.valueOf(-3)); + Double expected = Double.valueOf(5); + + Double actual = complexNumber.absolutValueOf(); + + assertEquals("The absolute value of an complex number with negative imaginary part should be the square root of the sum of real " + + "part times real part and imaginary part times imaginary part ", expected, actual); + } + + @Test + public void TheAbsoluteValueOfAComplexNumberWithNegativParts_IsNotTheAbsoluteValueOfIt() { + ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(-4), Double.valueOf(-3)); + Double expected = Double.valueOf(5); + + Double actual = complexNumber.absolutValueOf(); + + assertEquals("The absolute value of an complex number with negative parts should be the square root of the sum of real " + + "part times real part and imaginary part times imaginary part ", expected, actual); + } } \ No newline at end of file From 457af8fd1d46912e3d02b924a97c1a479a1c269a Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 18:16:10 +0200 Subject: [PATCH 10/19] removed a typo and added documentation to the absoluteValueOf function --- src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java | 4 ++++ .../complexnumcalc/AbsoluteValueOfComplexNumbersTest.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index b55cc87..ca5fddc 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -128,6 +128,10 @@ public class ComplexNumber { return qoutient; } + /** + * Calucates the absolute value of this complex number + * @return the absolute value + */ public Double absolutValueOf(){ Double absoluteValue = Math.sqrt(Math.pow(this.realPart, 2) + Math.pow(this.imaginaryPart, 2)) ; return absoluteValue; diff --git a/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java index 48a3d70..594ce13 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/AbsoluteValueOfComplexNumbersTest.java @@ -6,7 +6,7 @@ import org.junit.Test; public class AbsoluteValueOfComplexNumbersTest { @Test - public void TheAbsoluteValueOfAComplexNumberWithOnlyARealPart_IsNotTHeAbsoluteValueOfTheRealPart() { + public void TheAbsoluteValueOfAComplexNumberWithOnlyARealPart_IsNotTheAbsoluteValueOfTheRealPart() { ComplexNumber complexNumber = new ComplexNumber(Double.valueOf(4), Double.valueOf(0)); Double expected = Double.valueOf(4); From e8dfdfd5c93e599b56cf9fa0353054461f7a636c Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 18:40:13 +0200 Subject: [PATCH 11/19] Added conjugationOf to the ComplexNumber object --- .../ugsbo/complexnumcalc/ComplexNumber.java | 14 ++++++++++++ .../conjugationOfComplexNumbersTest.java | 22 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index ca5fddc..ade991d 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -137,4 +137,18 @@ public class ComplexNumber { return absoluteValue; } + /** + * Calucates the absolute value of this complex number + * @return the absolute value + */ + public ComplexNumber conjugationOf(){ + if(this.imaginaryPart.equals(Double.valueOf(0))){ + return this; + } else { + this.imaginaryPart *= (-1); + return this; + } + + } + } \ No newline at end of file diff --git a/src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java new file mode 100644 index 0000000..e996959 --- /dev/null +++ b/src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java @@ -0,0 +1,22 @@ +package com.ugsbo.complexnumcalc; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class conjugationOfComplexNumbersTest { + + @Test + public void TheConjugatedComplexNumberOfAComplexNumberWithOnlyARealPartShouldBeTheRealPart_ButItIsNot() { + Double realPart = Double.valueOf(4); + Double imaginaryPart = Double.valueOf(0); + ComplexNumber complexNumber = new ComplexNumber(realPart, imaginaryPart); + ComplexNumber expected = new ComplexNumber(realPart, imaginaryPart); + + ComplexNumber actual = complexNumber.conjugationOf(); + + assertTrue("TheConjugatedComplexNumberOfAComplexNumberWithOnlyARealPartIsTheRealPart", expected.equals(actual)); + //TODO change equals to equalTo + //assertThat("TheConjugatedComplexNumberOfAComplexNumberWithOnlyARealPartIsTheRealPart", expected, equalsTo(actual)); + } +} \ No newline at end of file From a83adacd60ad97a6c4ee06e60523b9425cf95059 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:14:30 +0200 Subject: [PATCH 12/19] Added hamcrest to the dependencies --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 65d9421..88b3b5b 100644 --- a/pom.xml +++ b/pom.xml @@ -24,6 +24,12 @@ 4.11 test + + org.hamcrest + hamcrest-junit + 2.0.0.0 + test + org.mockito From 99ca7b9d45ae6682653e82febca27f332d476d68 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:20:35 +0200 Subject: [PATCH 13/19] changed the equals methode to match java standart --- .../java/com/ugsbo/complexnumcalc/ComplexNumber.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java index ade991d..b05fea2 100644 --- a/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java +++ b/src/main/java/com/ugsbo/complexnumcalc/ComplexNumber.java @@ -48,12 +48,14 @@ public class ComplexNumber { * @param complexNumber The number wich gets compared with this Instance * @return True if the complex Numbers are Equal */ - public boolean equals(ComplexNumber complexNumber) { - if (this.realPart.equals(complexNumber.realPart) && this.imaginaryPart.equals(complexNumber.imaginaryPart)) { - return true; + @Override + public boolean equals(Object complexNumber) { + if (complexNumber instanceof ComplexNumber){ + ComplexNumber that = (ComplexNumber) complexNumber; + return this.realPart.equals(that.realPart) && this.imaginaryPart.equals(that.imaginaryPart); } else { return false; - } + } } /** From 3cf9fc1ba5a1fff9e8e043065516897de8f3c519 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:29:59 +0200 Subject: [PATCH 14/19] changed tests for the conjugation of conplex numbers to use hamcrest asserrThat --- .../conjugationOfComplexNumbersTest.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java index e996959..457ad39 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/conjugationOfComplexNumbersTest.java @@ -1,6 +1,7 @@ package com.ugsbo.complexnumcalc; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; import org.junit.Test; @@ -15,8 +16,18 @@ public class conjugationOfComplexNumbersTest { ComplexNumber actual = complexNumber.conjugationOf(); - assertTrue("TheConjugatedComplexNumberOfAComplexNumberWithOnlyARealPartIsTheRealPart", expected.equals(actual)); - //TODO change equals to equalTo - //assertThat("TheConjugatedComplexNumberOfAComplexNumberWithOnlyARealPartIsTheRealPart", expected, equalsTo(actual)); + assertThat("The conjugated complex Number of a complex number with only a real part is the real part", expected, equalTo(actual)); + } + + @Test + public void TheConjugatedComplexNumberOfAComplexNumberShouldBeTheComplexNumberWithSwapedSignImaginaryPart_ButItIsNot() { + Double realPart = Double.valueOf(4); + Double imaginaryPart = Double.valueOf(5); + ComplexNumber complexNumber = new ComplexNumber(realPart, imaginaryPart); + ComplexNumber expected = new ComplexNumber(realPart, -imaginaryPart); + + ComplexNumber actual = complexNumber.conjugationOf(); + + assertThat("The conjugated complex number of a complex number is the complex number with swaped sign in the imaginary part", expected, equalTo(actual)); } } \ No newline at end of file From ba9015387f724da9a5b59da80e792a0f1558db4a Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:34:02 +0200 Subject: [PATCH 15/19] Changed AddComplexNumberTest to use hamcrest assertThat instead of assertTrue --- .../com/ugsbo/complexnumcalc/AddComplexNumbersTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java index 644406f..6197380 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/AddComplexNumbersTest.java @@ -1,6 +1,7 @@ package com.ugsbo.complexnumcalc; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; import org.junit.Test; @@ -14,7 +15,7 @@ public class AddComplexNumbersTest { ComplexNumber sum = firstAddend.add(secoundAddend); - assertTrue("Dont sum to the sum", sum.equals(expected)); + assertThat("Dont sum to the sum", sum, equalTo(expected)); } @Test @@ -25,6 +26,6 @@ public class AddComplexNumbersTest { ComplexNumber sum = firstAddend.add(secoundAddend); - assertTrue("Dont sum to the sum", sum.equals(expected)); + assertThat("Dont sum to the sum", sum, equalTo(expected)); } } \ No newline at end of file From c1c08558ca92a9491b38a2df0b56b26da1510b43 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:36:21 +0200 Subject: [PATCH 16/19] changed SubstrationTests to use hamcrest assertThat instead of assertTrue --- .../ugsbo/complexnumcalc/SubstractComplexNumbersTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java index cc42978..2df14c3 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/SubstractComplexNumbersTest.java @@ -1,6 +1,7 @@ package com.ugsbo.complexnumcalc; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; import org.junit.Test; @@ -14,7 +15,7 @@ public class SubstractComplexNumbersTest { ComplexNumber difference = minuend.substract(subtrahend); - assertTrue("The difference is not as expected", difference.equals(expected)); + assertThat("The difference is not as expected", difference, equalTo(expected)); } @Test @@ -25,6 +26,6 @@ public class SubstractComplexNumbersTest { ComplexNumber difference = minuend.substract(subtrahend); - assertTrue("The difference is not as expected", difference.equals(expected)); + assertThat("The difference is not as expected", difference, equalTo(expected)); } } \ No newline at end of file From abed67ee689a0b1a507e5319471aca2c03f1c252 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:38:04 +0200 Subject: [PATCH 17/19] changed mutipication tests to use hamcrest asserThat instead of assertTrue --- .../ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java index 92f007c..96aed77 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/MultiplyComplexNumbersTest.java @@ -1,6 +1,7 @@ package com.ugsbo.complexnumcalc; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; import org.junit.Test; @@ -14,7 +15,7 @@ public class MultiplyComplexNumbersTest { ComplexNumber product = firstFaktor.multiply(secoundFaktor); - assertTrue("The product is not as expected", product.equals(expected)); + assertThat("The product is not as expected", product, equalTo(expected)); } @Test @@ -25,6 +26,6 @@ public class MultiplyComplexNumbersTest { ComplexNumber product = firstFaktor.multiply(secoundFaktor); - assertTrue("The product is not as expected", product.equals(expected)); + assertThat("The product is not as expected", product, equalTo(expected)); } } \ No newline at end of file From 940b433a49f54932b08d829e91a5b0fb4572425f Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:42:27 +0200 Subject: [PATCH 18/19] changed division test to use hamcrest assertThat instead of assertTrue --- .../com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java b/src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java index fd0e2e4..f0794a7 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/DivideComplexNumbersTest.java @@ -1,6 +1,7 @@ package com.ugsbo.complexnumcalc; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; import org.junit.Test; @@ -14,7 +15,7 @@ public class DivideComplexNumbersTest { ComplexNumber quotient = dividend.divide(divisor); - assertTrue("The quotient is not as expected", quotient.equals(expected)); + assertThat("The quotient is not as expected", quotient, equalTo(expected)); } @Test @@ -25,6 +26,6 @@ public class DivideComplexNumbersTest { ComplexNumber quotient = dividend.divide(divisor); - assertTrue("The quotient is not as expected", quotient.equals(expected)); + assertThat("The quotient is not as expected", quotient, equalTo(expected)); } } \ No newline at end of file From 08396a8d2c79aca4aa9d274773207a710fc9ad81 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Tue, 16 Jul 2019 19:53:06 +0200 Subject: [PATCH 19/19] fixed a Typo in the EqualsComplexNumversTest class to EqualsComplexNumbersTest class --- ...alsComplexNumversTest.java => EqualsComplexNumbersTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/test/java/com/ugsbo/complexnumcalc/{EqualsComplexNumversTest.java => EqualsComplexNumbersTest.java} (98%) diff --git a/src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumversTest.java b/src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumbersTest.java similarity index 98% rename from src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumversTest.java rename to src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumbersTest.java index 16a02c8..6d0a176 100644 --- a/src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumversTest.java +++ b/src/test/java/com/ugsbo/complexnumcalc/EqualsComplexNumbersTest.java @@ -5,7 +5,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; -public class EqualsComplexNumversTest { +public class EqualsComplexNumbersTest { @Test public void TwoEqualNumbersWithOnlyRealPart_AreNotDetectedAsEqual() {