Skip to content

Instantly share code, notes, and snippets.

@twogood
Created June 1, 2012 13:16
Show Gist options
  • Save twogood/2852081 to your computer and use it in GitHub Desktop.
Save twogood/2852081 to your computer and use it in GitHub Desktop.
TestNG Assert helpers for the Result class
import static org.testng.Assert.*;
public class AssertResult
{
static public void assertSucceeded(Result result)
{
assertTrue(result.succeeded(), result.getMessage());
}
static public void assertFailed(Result result)
{
assertFalse(result.succeeded());
}
static public void assertSucceeded(Result result, String message)
{
assertTrue(result.succeeded(), message);
}
static public void assertFailed(Result result, String message)
{
assertFalse(result.succeeded(), message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment