public static ParseException create(ParseExceptionType type, String tag, String context) { StringBuilder builder = new StringBuilder(); if (tag != null) { builder.Append(tag); } if (context != null) { if (builder.Length > 0) { builder.Append(" - "); } builder.Append(context); } if (builder.Length > 0) { return(new ParseException(type, builder.ToString())); } else { return(new ParseException(type)); } }
// JUnit specific setUp method... should be fine done as above... I think //protected override void setUp() //{ // mParseState = new ParseState(Encoding.UTF_8); //} protected void assertParseThrows(IExtTagParser handler, String line, ParseExceptionType exceptionType) { try { handler.parse(line, mParseState); Assert.False(true); } catch (ParseException exception) { Assert.Equal(exceptionType, exception.type); } }
public ParseException(ParseExceptionType type, String messageSuffix) { this.type = type; mMessageSuffix = messageSuffix; }
public ParseException(ParseExceptionType type) : this(type, null) { }
public static ParseException create(ParseExceptionType type, String tag) { return(create(type, tag, null)); }