public void ParsesRowWithExchangesCorrectly(string mapFileRow, PrimaryExchange expectedPrimaryExchange) { // Arrange var rowParts = mapFileRow.Split(','); var expectedMapFileRow = new MapFileRow( DateTime.ParseExact(rowParts[0], DateFormat.EightCharacter, CultureInfo.InvariantCulture), rowParts[1], Convert.ToChar(rowParts[2], CultureInfo.InvariantCulture)); // Act var actualMapFileRow = MapFileRow.Parse(mapFileRow); // Assert Assert.AreEqual(expectedPrimaryExchange, actualMapFileRow.PrimaryExchange); Assert.AreEqual(expectedMapFileRow, actualMapFileRow); }
public void ParsesRowWithoutExchangesCorrectly() { // Arrange var mapFileRow = "20010213,aapl"; var rowParts = mapFileRow.Split(','); var expectedMapFileRow = new MapFileRow( DateTime.ParseExact(rowParts[0], DateFormat.EightCharacter, CultureInfo.InvariantCulture), rowParts[1]); // Act var actualMapFileRow = MapFileRow.Parse(mapFileRow, QuantConnect.Market.USA, SecurityType.Equity); // Assert Assert.AreEqual(Exchange.UNKNOWN, actualMapFileRow.PrimaryExchange); Assert.AreEqual(expectedMapFileRow, actualMapFileRow); }
public void RowThrowsForUnknownMappingMode() { Assert.Throws <ArgumentException>(() => MapFileRow.Parse("20110418,cl uvvl4qhqe8xt,NYMEX,999", QuantConnect.Market.NYMEX, SecurityType.Future)); }