|
@@ -345,4 +345,41 @@ public class ArrazTest {
|
345
|
345
|
Assert.assertEquals(expectedMax, actualMax);
|
346
|
346
|
Assert.assertEquals(expectedMin, actualMin);
|
347
|
347
|
}
|
|
348
|
+
|
|
349
|
+ @Test
|
|
350
|
+ public void test1removeDupesFromArray() {
|
|
351
|
+ //GIVEN
|
|
352
|
+ int[] arr = {1, 2, 3, 4, 5, 3};
|
|
353
|
+ //WHEN
|
|
354
|
+ int expectedLength = 5;
|
|
355
|
+
|
|
356
|
+ int actualLength = arraz.removeDupesFromArray(arr).length;
|
|
357
|
+ //THEN
|
|
358
|
+ Assert.assertEquals(expectedLength, actualLength);
|
|
359
|
+ }
|
|
360
|
+
|
|
361
|
+ @Test
|
|
362
|
+ public void test2removeDupesFromArray() {
|
|
363
|
+ //GIVEN
|
|
364
|
+ int[] arr = {1, 2, 3, 4, 5, 3, 1, 1, 1, 2, 3, 4, 5};
|
|
365
|
+ //WHEN
|
|
366
|
+ int expectedLength = 5;
|
|
367
|
+
|
|
368
|
+ int actualLength = arraz.removeDupesFromArray(arr).length;
|
|
369
|
+ //THEN
|
|
370
|
+ Assert.assertEquals(expectedLength, actualLength);
|
|
371
|
+ }
|
|
372
|
+
|
|
373
|
+ @Test
|
|
374
|
+ public void test3removeDupesFromArray() {
|
|
375
|
+ //GIVEN
|
|
376
|
+ int[] arr = {1, 2, 3, 4, 5, 3, 1, 1, 1, 2, 3, 4, 5, 6};
|
|
377
|
+ //WHEN
|
|
378
|
+ int expected = 6;
|
|
379
|
+
|
|
380
|
+ int[] actualArray = arraz.removeDupesFromArray(arr);
|
|
381
|
+ int actual = actualArray[5];
|
|
382
|
+ //THEN
|
|
383
|
+ Assert.assertEquals(expected, actual);
|
|
384
|
+ }
|
348
|
385
|
}
|