Convert RUnit tests to testthat tests