예제 #1
0
 public void FloatParserTest()
 {
     string value = "3333333333D35C40";
     double expected = 115.3;
     RowLogContentsParser parser = new RowLogContentsParser();
     double actual = Hexconveters.ParseFloat(value);
     Assert.AreEqual(expected, actual);
 }
예제 #2
0
 public void IntParserBigNumberTest()
 {
     string value = "FEFFFF7F";
     int expected = 2147483646;
     RowLogContentsParser parser = new RowLogContentsParser();
     int actual = Hexconveters.ParseInt(value);
     Assert.AreEqual(expected, actual);
 }
예제 #3
0
 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);
 }
예제 #4
0
 public void DecimalParserBigNumberTest()
 {
     string value = "01FEFFFF7F00000000";
     decimal expected = 2147483646;
     RowLogContentsParser parser = new RowLogContentsParser();
     decimal actual = Hexconveters.ParseDecimal(value);
     Assert.AreEqual(expected, actual);
 }
예제 #5
0
 public void BitParserTest()
 {
     string value = "01";
     bool expected = true;
     RowLogContentsParser parser = new RowLogContentsParser();
     bool actual = Hexconveters.ParseBit(value);
     Assert.AreEqual(expected, actual);
 }
예제 #6
0
 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);
 }
예제 #7
0
 public void MoneyParserTest()
 {
     string value = "E0B1FFFF87130000";
     decimal expected = 2147483646;
     RowLogContentsParser parser = new RowLogContentsParser();
     decimal actual = Hexconveters.ParseMoney(value);
     Assert.AreEqual(expected, actual);
 }
예제 #8
0
 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);
 }
예제 #9
0
 public void TinyIntParserTest()
 {
     string value = "01";
     short expected = 1;
     RowLogContentsParser parser = new RowLogContentsParser();
     short actual = Hexconveters.ParseTinyInt(value);
     Assert.AreEqual(expected, actual);
 }
예제 #10
0
 public void RealParserTest()
 {
     string value = "0000004F";
     Single expected = 2147483646;
     RowLogContentsParser parser = new RowLogContentsParser();
     Single actual = Hexconveters.ParseReal(value);
     Assert.AreEqual(expected, actual);
 }