Package h07.experiment
Class ChickenNuggetsTest
- java.lang.Object
-
- h07.util.TestClass
-
- h07.experiment.ChickenNuggetsTest
-
public class ChickenNuggetsTest extends TestClass
Tests for classChickenNuggets
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class h07.util.TestClass
TestClass.MissingMemberException
-
-
Field Summary
Fields Modifier and Type Field Description Method
computePackageNumbers
Method
object forChickenNuggets.computePackageNumbers(int)
-
Fields inherited from class h07.util.TestClass
classDescriptor, className, constructor, fields, methods, RANDOM
-
-
Constructor Summary
Constructors Constructor Description ChickenNuggetsTest()
Creates a newChickenNuggetsTest
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testComputePackageNumbers(int numberOfNuggets, int[] expectedPackageNumbers)
Tests forChickenNuggets.computePackageNumbers(int)
.void
testDefinition()
Tests the definition ofChickenNuggets
.-
Methods inherited from class h07.util.TestClass
getClassForName, getFieldByCriteria, getFieldByName, getMethodByCriteria, getMethodByName, getMethodSignature, invokeExpectingException, newInstance, newInstanceExpectingException, testInstance
-
-
-
-
Field Detail
-
computePackageNumbers
public final Method computePackageNumbers
Method
object forChickenNuggets.computePackageNumbers(int)
-
-
Constructor Detail
-
ChickenNuggetsTest
public ChickenNuggetsTest()
Creates a newChickenNuggetsTest
object. Requires thatChickenNuggets
exists.
-
-
Method Detail
-
testDefinition
@Test public void testDefinition()
Tests the definition ofChickenNuggets
.- Asserts that the class is public
- Asserts that
computePackageNumbers(int)
is public and static and has return typeint[]
- Specified by:
testDefinition
in classTestClass
-
testComputePackageNumbers
@ParameterizedTest @ArgumentsSource(NuggetProvider.class) public void testComputePackageNumbers(int numberOfNuggets, int[] expectedPackageNumbers) throws ReflectiveOperationException
Tests forChickenNuggets.computePackageNumbers(int)
.
Asserts that the tested method returns an array with the same values as expected.- Throws:
ReflectiveOperationException
- if any invocation fails
-
-