added tests and first resolveState implementation