Package h07.algebra
Class IntegerAdditionTest
- java.lang.Object
-
- h07.util.TestClass
-
- h07.algebra.IntegerAdditionTest
-
public class IntegerAdditionTest extends TestClass
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class h07.util.TestClass
TestClass.MissingMemberException
-
-
Field Summary
Fields Modifier and Type Field Description Method
add
Method
object forMonoid.add(M, M)
private TemplateTests.MonoidTemplateTest
monoid
Instance ofTemplateTests.MonoidTemplateTest
Method
zero
Method
object forMonoid.zero()
-
Fields inherited from class h07.util.TestClass
classDescriptor, className, constructor, fields, methods, RANDOM
-
-
Constructor Summary
Constructors Constructor Description IntegerAdditionTest()
Creates a newIntegerAdditionTest
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testAdd()
Asserts thatIntegerAddition.add(Integer, Integer)
returns the sum of the two given integers.void
testDefinition()
Tests the definition ofIntegerAddition
.void
testZero()
Asserts thatIntegerAddition.zero()
returns 0.-
Methods inherited from class h07.util.TestClass
getClassForName, getFieldByCriteria, getFieldByName, getMethodByCriteria, getMethodByName, getMethodSignature, invokeExpectingException, newInstance, newInstanceExpectingException, testInstance
-
-
-
-
Field Detail
-
zero
public final Method zero
Method
object forMonoid.zero()
-
add
public final Method add
Method
object forMonoid.add(M, M)
-
monoid
private final TemplateTests.MonoidTemplateTest monoid
Instance ofTemplateTests.MonoidTemplateTest
-
-
Constructor Detail
-
IntegerAdditionTest
public IntegerAdditionTest()
Creates a newIntegerAdditionTest
object. Requires thatIntegerAddition
exists and has a constructor with no parameters.
-
-
Method Detail
-
testDefinition
@Test public void testDefinition()
Tests the definition ofIntegerAddition
.- Asserts that the class...
- is public
- is not abstract
- implements
Monoid
- Asserts that the constructor...
- is public
- is the only constructor of this class
- Asserts that the class is stateless (no fields)
- Specified by:
testDefinition
in classTestClass
- Asserts that the class...
-
testZero
@Test public void testZero() throws ReflectiveOperationException
Asserts thatIntegerAddition.zero()
returns 0.- Throws:
ReflectiveOperationException
- if any invocation fails
-
testAdd
@Test public void testAdd() throws ReflectiveOperationException
Asserts thatIntegerAddition.add(Integer, Integer)
returns the sum of the two given integers.- Throws:
ReflectiveOperationException
- if any invocation fails
-
-