public void ReturnsCorrectBrokerageSymbol() { var mapper = new InteractiveBrokersSymbolMapper(); var symbol = Symbol.Create("EURUSD", SecurityType.Forex, Market.FXCM); var brokerageSymbol = mapper.GetBrokerageSymbol(symbol); Assert.AreEqual("EURUSD", brokerageSymbol); symbol = Symbol.Create("AAPL", SecurityType.Equity, Market.USA); brokerageSymbol = mapper.GetBrokerageSymbol(symbol); Assert.AreEqual("AAPL", brokerageSymbol); }
public void ThrowsOnNullOrEmptyOrInvalidSymbol() { var mapper = new InteractiveBrokersSymbolMapper(); Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol(null, SecurityType.Forex, Market.FXCM)); Assert.Throws<ArgumentException>(() => mapper.GetLeanSymbol("", SecurityType.Forex, Market.FXCM)); var symbol = Symbol.Empty; Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(symbol)); symbol = null; Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(symbol)); symbol = Symbol.Create("", SecurityType.Forex, Market.FXCM); Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(symbol)); symbol = Symbol.Create("ABC_XYZ", SecurityType.Forex, Market.FXCM); Assert.Throws<ArgumentException>(() => mapper.GetBrokerageSymbol(symbol)); }