From 5abb777e0a7ef8d5dbb20e3dc6b3fe63537f2ef1 Mon Sep 17 00:00:00 2001 From: anhducc13 Date: Sat, 14 Sep 2019 22:44:40 +0700 Subject: [PATCH 1/2] Update VectorScalarProductTest.java add test for case max or min integer --- .../pedrovgs/problem2/VectorScalarProductTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/com/github/pedrovgs/problem2/VectorScalarProductTest.java b/src/test/java/com/github/pedrovgs/problem2/VectorScalarProductTest.java index 8cf5e310..ac2f46f0 100644 --- a/src/test/java/com/github/pedrovgs/problem2/VectorScalarProductTest.java +++ b/src/test/java/com/github/pedrovgs/problem2/VectorScalarProductTest.java @@ -79,4 +79,17 @@ public void differentSizeVectorsShouldThrowException() { assertEquals(-4, result); } + @Test public void shouldReturnTrueValueIfHasProductOfMaxIntegerAndZero() { + int max = Integer.MAX_VALUE; + Vector v1 = new Vector(max, max, max, max); + Vector v2 = new Vector(0, 0, 0, 0); + assertEquals(0, vectorScalarProduct.calculateScalarProduct(v1, v2)); + } + + @Test public void shouldReturnTrueValueIfHasProductOfMinIntegerAndZero() { + int min = Integer.MIN_VALUE; + Vector v1 = new Vector(min, min, min, min); + Vector v2 = new Vector(0, 0, 0, 0); + assertEquals(0, vectorScalarProduct.calculateScalarProduct(v1, v2)); + } } From 179d1393ec7f6e906fc730af20f8de9adfb4479b Mon Sep 17 00:00:00 2001 From: ductt-teko Date: Sun, 15 Sep 2019 21:19:26 +0700 Subject: [PATCH 2/2] Update pom.xml update pom.xml --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index b61fd665..057b8661 100644 --- a/pom.xml +++ b/pom.xml @@ -30,6 +30,8 @@ true true checkstyle.xml + 1.6 + 1.6