add assertion method

add an assertion method so it can easily be used inside tests.