コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: MapFileTests.cs プロジェクト: vishalbelsare/Lean
        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);
        }
コード例 #3
0
 public void RowThrowsForUnknownMappingMode()
 {
     Assert.Throws <ArgumentException>(() => MapFileRow.Parse("20110418,cl uvvl4qhqe8xt,NYMEX,999", QuantConnect.Market.NYMEX, SecurityType.Future));
 }