public void RepeatingGroup() { QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary(); dd.Load("../../../spec/fix/FIX42.xml"); QuickFix.FIX42.News news = new QuickFix.FIX42.News(new QuickFix.Fields.Headline("Foo headline")); QuickFix.FIX42.News.LinesOfTextGroup group1 = new QuickFix.FIX42.News.LinesOfTextGroup(); group1.Text = new QuickFix.Fields.Text("line1"); group1.EncodedTextLen = new QuickFix.Fields.EncodedTextLen(3); group1.EncodedText = new QuickFix.Fields.EncodedText("aaa"); news.AddGroup(group1); QuickFix.FIX42.News.LinesOfTextGroup group2 = new QuickFix.FIX42.News.LinesOfTextGroup(); group2.Text = new QuickFix.Fields.Text("line2"); group2.EncodedText = new QuickFix.Fields.EncodedText("bbb"); news.AddGroup(group2); string raw = news.ToString(); string nul = "\x01"; StringAssert.Contains( nul + "33=2" + nul + "58=line1" + nul + "354=3" + nul + "355=aaa" + nul + "58=line2" + nul + "355=bbb", raw); }
public void RepeatingGroup_ReuseObject() { QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary(); dd.Load("../../../spec/fix/FIX42.xml"); QuickFix.FIX42.News news = new QuickFix.FIX42.News(new QuickFix.Fields.Headline("Foo headline")); QuickFix.FIX42.News.LinesOfTextGroup group = new QuickFix.FIX42.News.LinesOfTextGroup(); group.Text = new QuickFix.Fields.Text("line1"); news.AddGroup(group); group.Text = new QuickFix.Fields.Text("line2"); news.AddGroup(group); string raw = news.ToString(); string nul = "\x01"; StringAssert.Contains( nul + "33=2" + nul + "58=line1" + nul + "58=line2", raw); }
/// <summary> /// Create a News message. Nothing unexpected here. /// </summary> /// <param name="headline_str"></param> /// <param name="lines"></param> /// <returns></returns> static public QuickFix.FIX42.News News(string headline_str, IList<string> lines) { QuickFix.Fields.Headline headline = new QuickFix.Fields.Headline(headline_str); QuickFix.FIX42.News news = new QuickFix.FIX42.News(headline); QuickFix.FIX42.News.LinesOfTextGroup group = new QuickFix.FIX42.News.LinesOfTextGroup(); foreach (string s in lines) { group.Text = new QuickFix.Fields.Text(s); news.AddGroup(group); } if (lines.Count == 0) { QuickFix.Fields.LinesOfText noLines = new QuickFix.Fields.LinesOfText(0); news.SetField(noLines, true); } return news; }
/// <summary> /// Create a News message. Nothing unexpected here. /// </summary> /// <param name="headline_str"></param> /// <param name="lines"></param> /// <returns></returns> static public QuickFix.FIX42.News News(string headline_str, IList <string> lines) { QuickFix.Fields.Headline headline = new QuickFix.Fields.Headline(headline_str); QuickFix.FIX42.News news = new QuickFix.FIX42.News(headline); QuickFix.FIX42.News.LinesOfTextGroup group = new QuickFix.FIX42.News.LinesOfTextGroup(); foreach (string s in lines) { group.Text = new QuickFix.Fields.Text(s); news.AddGroup(group); } if (lines.Count == 0) { QuickFix.Fields.LinesOfText noLines = new QuickFix.Fields.LinesOfText(0); news.SetField(noLines, true); } return(news); }