public void RenderTest() { FakeAdapter fakeAdapter = new FakeAdapter(); DataRender dataRender = new DataRender(fakeAdapter); StringWriter sb = new StringWriter(); dataRender.Render(sb); var result = sb.ToString(); Console.Write(result); var count = result.Count(c => c == '\n'); Assert.AreEqual(1, count); }
public static void StreamDataTable(object DataObjectsForStreaming, TextWriter streamResponse, bool useAttr, CultureInfo cFrom, CultureInfo cTo, SessionQuery query) { if (DataObjectsForStreaming == null || !(DataObjectsForStreaming is DataObjectForStreaming)) { throw new Exception("Data not found"); } DataObjectForStreaming DataStream = (DataObjectForStreaming)DataObjectsForStreaming; #region CheckLayout DataStream.layObj.axis_x.ForEach(axisX => { if (!DataStream.store.ExistsColumn(axisX)) { DataStream.layObj.axis_x.Remove(axisX); } }); DataStream.layObj.axis_y.ForEach(axisY => { if (!DataStream.store.ExistsColumn(axisY)) { DataStream.layObj.axis_y.Remove(axisY); } }); DataStream.layObj.axis_z.ForEach(axisZ => { if (!DataStream.store.ExistsColumn(axisZ)) { DataStream.layObj.axis_z.Remove(axisZ); } }); #endregion DataRender rea = new DataRender( DataStream.store, DataStream.Criterias, DataStream.layObj, DataStream.structure, DataStream.codemap, useAttr, cFrom, cTo); rea.render(streamResponse, query); //DataStream.store.Dispose(); }