public void InvalidToken_WrongHexColor() { Assert.Throws <UssInvalidTokenException>(() => { UssLexer.ParseOne("#..zuzu.."); }); Assert.DoesNotThrow(() => { UssLexer.ParseOne("#ABABAB"); }); }
public void ParseOne_Number() { var parsed = UssLexer.ParseOne("1234"); Assert.AreEqual(UssTokenType.Int, parsed.type); parsed = UssLexer.ParseOne("123.4"); Assert.AreEqual(UssTokenType.Float, parsed.type); }
public void InvalidToken_LongNumber() { // INTEGER Assert.Throws <UssInvalidTokenException>(() => { UssLexer.ParseOne("123412341234213124123214123124213"); }); Assert.DoesNotThrow(() => { UssLexer.ParseOne("1234"); }); // FLOAT Assert.Throws <UssInvalidTokenException>(() => { UssLexer.ParseOne("12341234123.4213124123214123124213"); }); Assert.DoesNotThrow(() => { UssLexer.ParseOne("123.4"); }); }
public void ParseOne() { var parsed = UssLexer.ParseOne("#ABABAB"); Assert.AreEqual(UssTokenType.HexColor, parsed.type); }
public void ParseOne_ValueRef() { var parsed = UssLexer.ParseOne("@asdf"); Assert.AreEqual(UssTokenType.ValueRef, parsed.type); }