public void TestNullParameter() { var ap = new ArgumentAttributeParser(); const string attIdentifier = "argument"; var e = Assert.Catch(() => { ap.ParsedAttribute(attIdentifier, new NParsedAttributeAtomic(new ParsedFloat()), new NParsedAttributeAtomic(new IdentifierExpression("software"))); }); Assert.IsInstanceOf(typeof(InvalidParameterAttributeException), e); StringAssert.AreEqualIgnoringCase( string.Format(InvalidParameterAttributeException.NO_PARAM, attIdentifier), e.Message ); }
public void TestNotColonValue(NParsedAttributeValue v) { var ap = new ArgumentAttributeParser(); const string attIdentifier = "argument"; var e = Assert.Catch(() => { ap.ParsedAttribute(attIdentifier, null, v); }); Assert.IsInstanceOf(typeof(InvalidAttributeValueException), e); StringAssert.AreEqualIgnoringCase( string.Format(InvalidAttributeValueException.COLON_ONLY, attIdentifier), e.Message ); }
private static void TestInvalidColonValueHelper(ParsedElement left, ParsedElement right) { var ap = new ArgumentAttributeParser(); const string attIdentifier = "argument"; var e = Assert.Catch(() => { ap.ParsedAttribute(attIdentifier, null, new NParsedAttributeColon(left, right)); }); Assert.IsInstanceOf(typeof(InvalidAttributeValueException), e); StringAssert.AreEqualIgnoringCase( string.Format(InvalidAttributeValueException.IDENTIFIER, attIdentifier), e.Message ); }