Factored out an assertFrame function