Increasing HIV testing rates among high-risk groups should lead to increased numbers of cases being detected. Coupled with effective treatment and behavioural change among individuals with detected infection, increased testing should also reduce onward incidence of HIV in the population. However, it can be difficult to predict the strengths of these effects and thus the overall impact of testing. We construct a mathematical model of an ongoing HIV epidemic in a population of gay, bisexual and other men who have sex with men. The model incorporates different levels of infection risk, testing habits and awareness of HIV status among members of the population. We introduce a novel Bayesian analysis that is able to incorporate potentially unreliable sexual health survey data along with firm clinical diagnosis data. We parameterize the model using survey and diagnostic data drawn from a population of men in Vancouver, Canada. We predict that increasing testing frequency will yield a small-scale but long-term impact on the epidemic in terms of new infections averted, as well as a large short-term impact on numbers of detected cases. These effects are predicted to occur even when a testing intervention is short-lived. We show that a short-lived but intensive testing campaign can potentially produce many of the same benefits as a campaign that is less intensive but of longer duration.