private void ExpectBadRoute(string badRoute) { PageStack stack = new PageStack(); try { stack.RegisterRoute(badRoute, () => new Page()); Assert.Fail("An exception should have been thrown for bad route: "+ badRoute); } catch (FormatException) { } }