Teenagers who could vote for the first time next year put politicians through their paces at an event in Dumfries.