Package com.github.dreamhead.moco.verification

Source Code of com.github.dreamhead.moco.verification.AbstractTimesVerification

package com.github.dreamhead.moco.verification;

import com.github.dreamhead.moco.VerificationData;
import com.github.dreamhead.moco.VerificationException;
import com.github.dreamhead.moco.VerificationMode;

public abstract class AbstractTimesVerification implements VerificationMode {
    protected abstract boolean meet(final int size);
    protected abstract String expectedTip();

    @Override
    public void verify(final VerificationData data) {
        int actualSize = data.matchedSize();
        if (!meet(actualSize)) {
            throw new VerificationException(data.mismatchDescription(actualSize, expectedTip()));
        }
    }
}
TOP

Related Classes of com.github.dreamhead.moco.verification.AbstractTimesVerification

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.