Package samples.strict

Examples of samples.strict.StrictDemo


@PrepareForTest(StrictDemo.class)
public class StrictDemoTest {

  @Test
  public void testCallB_notStrict() throws Exception {
    StrictDemo tested = createPartialMock(StrictDemo.class, "A", "B");
    expectPrivate(tested, "B").times(1);
    expectPrivate(tested, "A").times(1);

    replay(tested);

    tested.callAThenB();

    verify(tested);
  }
View Full Code Here


    verify(tested);
  }

  @Test(expected = AssertionError.class)
  public void testCallB_strict_failure() throws Exception {
    StrictDemo tested = createStrictPartialMock(StrictDemo.class, "A", "B");
    expectPrivate(tested, "B").times(1);
    expectPrivate(tested, "A").times(1);

    replay(tested);

    tested.callAThenB();

    verify(tested);
  }
View Full Code Here

    verify(tested);
  }

  @Test
  public void testCallB_strict_ok() throws Exception {
    StrictDemo tested = createStrictPartialMock(StrictDemo.class, "A", "B");
    expectPrivate(tested, "A").times(1);
    expectPrivate(tested, "B").times(1);

    replay(tested);

    tested.callAThenB();

    verify(tested);
  }
View Full Code Here

TOP

Related Classes of samples.strict.StrictDemo

Copyright © 2018 www.massapicom. 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.