Towards a Theory of Generalized Bayes Tests