Uses of Class
io.github.valentinherrmann.levenshtein.MethodWrapper
-
Uses of MethodWrapper in io.github.valentinherrmann.levenshtein
Methods in io.github.valentinherrmann.levenshtein with parameters of type MethodWrapperModifier and TypeMethodDescriptionvoidMock.assertCalled(MethodWrapper<?, ?> method, int times) Fails unless the method was called exactlytimestimes onMock.obj().voidMock.assertCalled(MethodWrapper<?, ?> method, int times, Supplier<String> context) LikeMock.assertCalled(MethodWrapper, int), but the text ofcontextis put in front of the failure message, e.g. which call of the method under test should have called this method.voidMock.assertNotCalled(MethodWrapper<?, ?> method) Fails if the method was called onMock.obj().longMock.callCount(MethodWrapper<?, ?> method) How often a method was called onMock.obj()(or on a clone of it).Mock.calls(MethodWrapper<?, ?> method) The recorded calls of a method onMock.obj(), in call order: the first 1000<T> calls, seeMock.callCount(MethodWrapper)for the number of all calls.static FailureFailure.of(MethodWrapper<?, ?> method) Mock.override(MethodWrapper<?, ?> method, Function<Object[], Object> function) Replaces a method: every call of it runsfunctioninstead of the student's code.Mock.returning(MethodWrapper<?, ?> method, Object value) Replaces a method by one that always returnsvalue.voidClassWrapper.testGetter(AttributeWrapper<?, ?> attribute, MethodWrapper<?, ?> getter) Tests that a getter method returns the value of an attribute.voidClassWrapper.testGettersSetters(AttributeWrapper<?, ?> attribute, MethodWrapper<?, ?>... gettersSetters) Tests the getter and/or setter of an attribute without conditions, i.e. the setter stores every value and the getter returns the stored value.<V> voidClassWrapper.testGettersSetters(AttributeWrapper<?, ?> attribute, Predicate<V> setterCondition, MethodWrapper<?, ?>... gettersSetters) LikeClassWrapper.testGettersSetters(AttributeWrapper, MethodWrapper[]), but the setter must only store values for whichsetterConditionholds.<V> voidClassWrapper.testGettersSetters(AttributeWrapper<?, ?> attribute, List<V> sampleValues, MethodWrapper<?, ?>... gettersSetters) LikeClassWrapper.testGettersSetters(AttributeWrapper, MethodWrapper[]), but with own sample values instead of generated ones (required for types without generated values, e.g. own classes).<V> voidClassWrapper.testGettersSetters(AttributeWrapper<?, ?> attribute, List<V> sampleValues, Predicate<V> setterCondition, MethodWrapper<?, ?>... gettersSetters) CombinesClassWrapper.testGettersSetters(AttributeWrapper, List, MethodWrapper[])(own sample values) andClassWrapper.testGettersSetters(AttributeWrapper, Predicate, MethodWrapper[])(setter condition).Method parameters in io.github.valentinherrmann.levenshtein with type arguments of type MethodWrapperModifier and TypeMethodDescriptionClassWrapper.newObjOverriding(Map<MethodWrapper<?, ?>, Function<Object[], Object>> overrides) Creates an object of a subclass of the wrapped class in which each given method returns the result of its function.