Package org.mockserver.client.serialization.model

Source Code of org.mockserver.client.serialization.model.VerificationTimesDTOTest

package org.mockserver.client.serialization.model;

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

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

public class VerificationTimesDTOTest {

    @Test
    public void shouldReturnValueSetInConstructor() {
        // when
        VerificationTimesDTO times = new VerificationTimesDTO(VerificationTimes.exactly(5));

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

    @Test
    public void shouldBuildCorrectObject() {
        // when
        VerificationTimes times = new VerificationTimesDTO(VerificationTimes.once()).buildObject();

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

        // when
        times = new VerificationTimesDTO(VerificationTimes.exactly(3)).buildObject();

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

        // when
        times = new VerificationTimesDTO(VerificationTimes.atLeast(3)).buildObject();

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

}
TOP

Related Classes of org.mockserver.client.serialization.model.VerificationTimesDTOTest

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.