1/* 2 * Copyright (c) 2007 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 6package org.mockito.internal.progress; 7 8import org.junit.Rule; 9import org.junit.Test; 10import org.junit.rules.ExpectedException; 11import org.mockito.exceptions.base.MockitoException; 12import org.mockito.internal.verification.VerificationModeFactory; 13 14 15public class TimesTest { 16 @Rule 17 public ExpectedException exception = ExpectedException.none(); 18 19 @Test 20 public void shouldNotAllowNegativeNumberOfInvocations() throws Exception { 21 22 exception.expect(MockitoException.class); 23 exception.expectMessage("Negative value is not allowed here"); 24 25 VerificationModeFactory.times(-50); 26 } 27} 28