public void ConvertValidDateTimeStringsReturnsValidDateTime()
 {
     var res = String2DateTime.Convert("20151123", "100226");
     var expectedDate = new DateTime(2015, 11, 23, 10, 02, 26);
     Assert.IsNotNull(res);
     Assert.AreEqual(expectedDate, res);
 }
 public void ConvertDateWithZeroTimeReturnsValidDateTime()
 {
     var res = String2DateTime.Convert("20151123", "0");
     var expectedDate = new DateTime(2015, 11, 23, 0, 0, 0);
     Assert.IsNotNull(res);
     Assert.AreEqual(expectedDate, res);
 }
Esempio n. 3
0
 // <TICKER>,<PER>,<DATE>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
 public BarCsvMap()
 {
     Map(m => m.DateTime).ConvertUsing(row => String2DateTime.Convert(row.GetField <string>("<DATE>"), row.GetField <string>("<TIME>")));
     Map(m => m.Symbol).Name("<TICKER>");
     Map(m => m.Period).Name("<PER>");
     Map(m => m.Open).Name("<OPEN>");
     Map(m => m.High).Name("<HIGH>");
     Map(m => m.Low).Name("<LOW>");
     Map(m => m.Close).Name("<CLOSE>");
     Map(m => m.Volume).Name("<VOL>");
 }
 public void ConvertEmptyDateStringReturnsNull()
 {
     var res = String2DateTime.Convert(string.Empty);
     Assert.IsNull(res);
 }