Package org.mockserver.model

Source Code of org.mockserver.model.VerificationTimesTest

package org.mockserver.model;

import org.junit.Test;
import org.mockserver.verify.VerificationTimes;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockserver.verify.VerificationTimes.atLeast;
import static org.mockserver.verify.VerificationTimes.exactly;
import static org.mockserver.verify.VerificationTimes.once;

/**
* @author jamesdbloom
*/
public class VerificationTimesTest {

    @Test
    public void shouldCreateCorrectObjectForAtLeast() {
        // when
        VerificationTimes times = atLeast(2);

        // then
        assertThat(times.isExact(), is(false));
        assertThat(times.getCount(), is(2));
    }

    @Test
    public void shouldCreateCorrectObjectForExactly() {
        // when
        VerificationTimes times = exactly(2);

        // then
        assertThat(times.isExact(), is(true));
        assertThat(times.getCount(), is(2));
    }
    @Test
    public void shouldCreateCorrectObjectForOnce() {
        // when
        VerificationTimes times = once();

        // then
        assertThat(times.isExact(), is(true));
        assertThat(times.getCount(), is(1));
    }

}
TOP

Related Classes of org.mockserver.model.VerificationTimesTest

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.