From 6c5989e12f15df61ecedbb5357c3e8c7688c9b23 Mon Sep 17 00:00:00 2001 From: JPANZO Date: Tue, 15 Feb 2022 21:00:25 +0100 Subject: [PATCH] getOptions from CDPlayer tested on ArrayLengthGreaterThen 0. --- src/main/java/device/cdPlayer/CDPlayer.java | 10 +++++++++- src/test/java/device/cdPlayer/CDPlayerTest.java | 10 ++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/device/cdPlayer/CDPlayer.java b/src/main/java/device/cdPlayer/CDPlayer.java index 66d8bfb..bdf1995 100644 --- a/src/main/java/device/cdPlayer/CDPlayer.java +++ b/src/main/java/device/cdPlayer/CDPlayer.java @@ -2,6 +2,8 @@ package device.cdPlayer; import device.Device; import device.cdPlayer.exceptions.*; + +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -69,7 +71,13 @@ public class CDPlayer implements Device { @Override public String[] getOptions() { - return new String[]{}; + Method[] methods=this.getClass().getDeclaredMethods(); + String[] outMethods=new String[methods.length]; + + for (int i = 0; i getOptionsTestData () { CDPlayer cdPlayer1 = new CDPlayer(); return Stream.of( - Arguments.of("[getOptions(): shouldNotReturnsNull] => ReturnValueNotNull", "ReturnValueNotNull", cdPlayer1,null) + Arguments.of("[getOptions(): shouldNotReturnNull] => ReturnValueNotNull", "ReturnValueNotNull", cdPlayer1,null), + Arguments.of("[getOptions(): shouldReturnAnArrayWithLengthGreaterThen0] => ArrayLengthGreaterThen0", "ArrayLengthGreaterThen0", cdPlayer1,null) ); }