public void FloatParserTest() { string value = "3333333333D35C40"; double expected = 115.3; RowLogContentsParser parser = new RowLogContentsParser(); double actual = Hexconveters.ParseFloat(value); Assert.AreEqual(expected, actual); }
public void IntParserBigNumberTest() { string value = "FEFFFF7F"; int expected = 2147483646; RowLogContentsParser parser = new RowLogContentsParser(); int actual = Hexconveters.ParseInt(value); Assert.AreEqual(expected, actual); }
public void CharParserTest() { string value = "48656C6C6F2C204920616D204A6F736570682120"; string expected = "Hello, I am Joseph!"; RowLogContentsParser parser = new RowLogContentsParser(); string actual = Hexconveters.ParseChar(value); Assert.AreEqual(expected, actual); }
public void DecimalParserBigNumberTest() { string value = "01FEFFFF7F00000000"; decimal expected = 2147483646; RowLogContentsParser parser = new RowLogContentsParser(); decimal actual = Hexconveters.ParseDecimal(value); Assert.AreEqual(expected, actual); }
public void BitParserTest() { string value = "01"; bool expected = true; RowLogContentsParser parser = new RowLogContentsParser(); bool actual = Hexconveters.ParseBit(value); Assert.AreEqual(expected, actual); }
public void BinaryParserTest() { string value = "8d7e6a5d4b3e2e1f"; string expected = "8d7e6a5d4b3e2e1f".ToUpper(); RowLogContentsParser parser = new RowLogContentsParser(); string actual = BitConverter.ToString(Hexconveters.ParseBinary(value)).Replace("-", string.Empty); Assert.AreEqual(expected, actual); }
public void MoneyParserTest() { string value = "E0B1FFFF87130000"; decimal expected = 2147483646; RowLogContentsParser parser = new RowLogContentsParser(); decimal actual = Hexconveters.ParseMoney(value); Assert.AreEqual(expected, actual); }
public void TransactionLogTest() { var expected = new List<TransactionLogItem>(); var tlparser = new TransactionLogParser(); var hvparser = new RowLogContentsParser(); var values = tlparser.GetMetadata("Testing","testintable2"); for (int i = 0, x = 0; i < values.Count - x; i++) { if (values.ElementAt(i).Type == XType.VarChar) { var value = values.ElementAt(i); values.RemoveAt(i); values.Add(value); i = -1; x++; } } var values2 = tlparser.GetRowLogContents("Testing","testintable2"); var ceja = values2; var parsedLogs = hvparser.ParseRowLogContents(values2.ElementAt(0), values); Assert.AreEqual(expected, values2); }
public void TinyIntParserTest() { string value = "01"; short expected = 1; RowLogContentsParser parser = new RowLogContentsParser(); short actual = Hexconveters.ParseTinyInt(value); Assert.AreEqual(expected, actual); }
public void RealParserTest() { string value = "0000004F"; Single expected = 2147483646; RowLogContentsParser parser = new RowLogContentsParser(); Single actual = Hexconveters.ParseReal(value); Assert.AreEqual(expected, actual); }