package net.teamio.blockunit;

/**
 * Created by oliver on 2017-07-03.
 */
public class TestingHarness {
	public void assertEquals(int a, int b) {
		if (a != b) {
			throw new TestAssertionException("AssertEquals: %d is not equal to %d", a, b);
		}
	}

	public void assertEquals(boolean a, boolean b) {
		if (a != b) {
			throw new TestAssertionException("AssertEquals: %s is not equal to %s", a, b);
		}
	}

	public void assertNull(Object o) {
		if (o != null) {
			throw new TestAssertionException("AssertNull: passed object is not null");
		}
	}

	public void assertNotNull(Object o) {
		if (o == null) {
			throw new TestAssertionException("AssertNotNull: passed object is null");
		}
	}

	public void assertTrue(boolean b) {
		if (!b) {
			throw new TestAssertionException("AssertTrue: passed value is false");
		}
	}

	public void assertFalse(boolean b) {
		if (b) {
			throw new TestAssertionException("AssertFalse: passed value is true");
		}
	}
}

@@ -946,11 +946,192 @@
 ;%0A%09%09%7D%0A%09%7D
+%0A%0A%09public void fail() %7B%0A%09%09throw new TestAssertionException(%22Test failed%22);%0A%09%7D%0A%0A%09public void fail(String message) %7B%0A%09%09throw new TestAssertionException(%22Test failed: %25s%22, message);%0A%09%7D
 %0A%7D%0A

Add fail option to testing harness