Skip to content

Instantly share code, notes, and snippets.

@ivanursul
Created April 1, 2015 15:04
Show Gist options
  • Select an option

  • Save ivanursul/bac0bac583210d52d5fa to your computer and use it in GitHub Desktop.

Select an option

Save ivanursul/bac0bac583210d52d5fa to your computer and use it in GitHub Desktop.
DefaultTest.java for www.ivanursul.com
package org.ivanursul.investigration.rule;
import static org.junit.Assert.assertTrue;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
public class DefaultTest {
@Rule
public ExpectedException exception = ExpectedException.none();
@Test
public void throwsIllegalArgumentExceptionIfIconIsNull() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("Icon is null, not a file, or doesn't exist.");
throw new IllegalArgumentException("Icon is null, not a file, or doesn't exist.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment