public void OptionOSIParse() { string osi = "YHOO100416C00020000"; Security sec = new SecurityImpl(); Assert .IsTrue(SecurityImpl.ParseOptionOSI(osi, ref sec, rt.d), "parsing osi had an error"); Assert.AreEqual("YHOO", sec.Symbol, "symbol incorrect"); Assert.AreEqual(20100416, sec.Date, "date incorrect"); Assert.AreEqual(20, sec.Strike, "strike incorrect"); Assert.IsTrue(sec.isCall, "not a call"); }
public void OptionSec2OSI() { string osi1 = "YHOO100416C00020000"; string osi2 = "AAPL 111022P420000"; Security sec = new SecurityImpl(); Assert .IsTrue(SecurityImpl.ParseOptionOSI(osi1, ref sec, rt.d), "parsing osi1 had an error"); Assert.AreEqual("YHOO 100416C20000", SecurityImpl.ToOSISymbol(sec), "converting to osi1 failed"); Assert .IsTrue(SecurityImpl.ParseOptionOSI(osi2, ref sec, rt.d), "parsing osi2 had an error"); Assert.AreEqual("AAPL 111022P420000", SecurityImpl.ToOSISymbol(sec), "converting to osi2 failed"); }