private void TryParseInvalid(String parseString) { try { PlaceholderParser.ParsePlaceholder(parseString); Assert.Fail(); } catch (PlaceholderParseException) { // expected } }
public void TestParseValid(Object[] inputAndResults) { String parseString = (String)inputAndResults[0]; Object[] expected = (Object[])inputAndResults[1]; IList <PlaceholderParser.Fragment> result = PlaceholderParser.ParsePlaceholder(parseString); Assert.AreEqual(expected.Length, result.Count, "Incorrect count for '" + parseString + "'"); for (int i = 0; i < expected.Length; i++) { Assert.AreEqual(expected[i], result[i], "Incorrect value for '" + parseString + "' at " + i); } }