public void TestWithInvalidNumber() { var extractor = new NumericTokenExtractor(); var token = extractor.ExtractToken("abc", 0, new Context(ExpressiveOptions.None)); Assert.IsNull(token); }
public void TestWithMultipleDecimalPlaces() { var extractor = new NumericTokenExtractor(); var token = extractor.ExtractToken("123.45.678", 0, new Context(ExpressiveOptions.None)); Assert.IsNotNull(token); Assert.AreEqual("123.45", token.CurrentToken); }
public void TestWithDecimalPlaceAndNegativeSign() { var extractor = new NumericTokenExtractor(); var token = extractor.ExtractToken("-123.45", 0, new Context(ExpressiveOptions.None)); Assert.IsNotNull(token); Assert.AreEqual("-123.45", token.CurrentToken); }
public void TestWithIntegerAndPositiveSign() { var extractor = new NumericTokenExtractor(); var token = extractor.ExtractToken("+123", 0, new Context(ExpressiveOptions.None)); Assert.IsNotNull(token); Assert.AreEqual("+123", token.CurrentToken); }
public void TestWithScientificNotationAndNegativeSign() { var extractor = new NumericTokenExtractor(); var token = extractor.ExtractToken("1.23e-2", 0, new Context(ExpressiveOptions.None)); Assert.IsNotNull(token); Assert.AreEqual("1.23e-2", token.CurrentToken); }