Rename QueryTest and refactor it to use DatabaseSwitcher to set Context.Database that Query relies on
Make DbTemplate inherit from DbItem and align their APIs
Add template items into fake items collection so that template items can be queried using Sitecore item APIs
Make sure BaseIDs from the DbTemplate propagate not only to Template.BaseIDs but also to the TemplateItem as a value of __Base template field