add typeOfResource test
add more tests; factor out methods for building elements