public void XmlTranslator_ConvertAndFilter_WhenRecordsetWithGaps_ExpectRowAnnotations() { //------------Setup for test-------------------------- IDataListTranslator xmlConverter = Dls.GetTranslator(XmlFormatWithoutSystemTags); IBinaryDataList dl1 = Dev2BinaryDataListFactory.CreateDataList(GlobalConstants.NullDataListID); string error; var cols = new List <Dev2Column> { DataListFactory.CreateDev2Column("val", string.Empty) }; dl1.TryCreateRecordsetTemplate("rs", string.Empty, cols, true, out error); dl1.TryCreateRecordsetValue("1", "val", "rs", 1, out error); dl1.TryCreateRecordsetValue("3", "val", "rs", 3, out error); //------------Execute Test--------------------------- ErrorResultTO errors; var actual = xmlConverter.ConvertAndFilter(dl1, "<root><rs><val/></rs></root>".ToStringBuilder(), out errors); actual = actual.Replace("\r", "").Replace("\n", ""); //------------Assert Results------------------------- const string expected = "<rs index=\"1\"><val>1</val></rs><rs index=\"3\"><val>3</val></rs>"; StringAssert.Contains(actual.ToString(), expected, "rowID attribute not present"); }
public void DeSerializeToXMLInputsOnlyFromBinary_ValidXML_Expect_Sucess() { IBinaryDataList dl = Dev2BinaryDataListFactory.CreateDataList(); List <Dev2Column> cols1 = new List <Dev2Column> { DataListFactory.CreateDev2Column("f1", ""), }; List <Dev2Column> cols2 = new List <Dev2Column> { DataListFactory.CreateDev2Column("f2", ""), }; string error; ErrorResultTO errors; IDataListTranslator xmlConverter = Dls.GetTranslator(XmlFormatInputsOnly); dl.TryCreateRecordsetTemplate("rs1", "", cols1, true, out error); dl.TryCreateRecordsetTemplate("rs2", "", cols2, true, true, enDev2ColumnArgumentDirection.Input, out error); dl.TryCreateScalarTemplate("", "scalar1", "", true, true, enDev2ColumnArgumentDirection.Input, out error); dl.TryCreateScalarTemplate("", "scalar2", "", true, true, enDev2ColumnArgumentDirection.Output, out error); dl.TryCreateScalarValue("scalar1Value", "scalar1", out error); dl.TryCreateScalarValue("scalar2Value", "scalar2", out error); dl.TryCreateRecordsetValue("rec1.f1.value", "f1", "rs1", 1, out error); dl.TryCreateRecordsetValue("rec1.f2.value", "f2", "rs2", 1, out error); dl.TryCreateRecordsetValue("rec2.f1.value", "f1", "rs1", 2, out error); dl.TryCreateRecordsetValue("rec2.f2.value", "f2", "rs2", 2, out error); DataListTranslatedPayloadTO tmp = xmlConverter.ConvertFrom(dl, out errors); string result = tmp.FetchAsString().ToString(); Assert.AreEqual("<DataList><scalar1>scalar1Value</scalar1></DataList>", result); }
public void MyTestInitialize() { string error; var dataListCompiler = DataListFactory.CreateDataListCompiler(); _dl1 = Dev2BinaryDataListFactory.CreateDataList(); _dl1.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl1.TryCreateScalarValue("[[otherScalar]]", "myScalar", out error); _dl1.TryCreateScalarTemplate(string.Empty, "otherScalar", "A scalar", true, out error); _dl1.TryCreateScalarValue("testRegion", "otherScalar", out error); _dl1.TryCreateScalarTemplate(string.Empty, "scalar1", "A scalar", true, out error); _dl1.TryCreateScalarValue("foobar", "scalar1", out error); IList <Dev2Column> cols = new List <Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f2")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f3")); _dl1.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl1.TryCreateRecordsetValue("r1.f1.value", "f1", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f3.value", "f3", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r2.f1.value", "f1", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f2.value", "f2", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f3.value", "f3", "recset", 2, out error); // skip 3 ;) _dl1.TryCreateRecordsetValue("r4.f1.value", "f1", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f2.value", "f2", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f3.value", "f3", "recset", 4, out error); dataListCompiler.PushBinaryDataList(_dl1.UID, _dl1, out _errors); //_compiler.UpsertSystemTag(dl1.UID, enSystemTag.EvaluateIteration, "true", out errors); /* list 2 */ _dl2 = Dev2BinaryDataListFactory.CreateDataList(); _dl2.TryCreateScalarTemplate(string.Empty, "idx", "A scalar", true, out error); _dl2.TryCreateScalarValue("1", "idx", out error); _dl2.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl2.TryCreateRecordsetValue("r1.f1.value", "f1", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1.f3.value", "f3", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r2.f1.value", "f1", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2.f2.value", "f2", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2.f3.value", "f3", "recset", 2, out error); dataListCompiler.PushBinaryDataList(_dl2.UID, _dl2, out _errors); //_compiler.UpsertSystemTag(dl2.UID, enSystemTag.EvaluateIteration, "true", out errors); }
public void MyTestInitialize() { string error; var dataListCompiler = DataListFactory.CreateDataListCompiler(); _dl1 = Dev2BinaryDataListFactory.CreateDataList(); _dl1.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl1.TryCreateScalarValue("[[otherScalar]]", "myScalar", out error); _dl1.TryCreateScalarTemplate(string.Empty, "otherScalar", "A scalar", true, out error); _dl1.TryCreateScalarValue("testRegion", "otherScalar", out error); _dl1.TryCreateScalarTemplate(string.Empty, "scalar1", "A scalar", true, out error); _dl1.TryCreateScalarValue("foobar", "scalar1", out error); IList<Dev2Column> cols = new List<Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f2")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f3")); _dl1.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl1.TryCreateRecordsetValue("r1.f1.value", "f1", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f3.value", "f3", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r2.f1.value", "f1", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f2.value", "f2", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f3.value", "f3", "recset", 2, out error); // skip 3 ;) _dl1.TryCreateRecordsetValue("r4.f1.value", "f1", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f2.value", "f2", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f3.value", "f3", "recset", 4, out error); dataListCompiler.PushBinaryDataList(_dl1.UID, _dl1, out _errors); //_compiler.UpsertSystemTag(dl1.UID, enSystemTag.EvaluateIteration, "true", out errors); /* list 2 */ _dl2 = Dev2BinaryDataListFactory.CreateDataList(); _dl2.TryCreateScalarTemplate(string.Empty, "idx", "A scalar", true, out error); _dl2.TryCreateScalarValue("1", "idx", out error); _dl2.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl2.TryCreateRecordsetValue("r1.f1.value", "f1", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1.f3.value", "f3", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r2.f1.value", "f1", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2.f2.value", "f2", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2.f3.value", "f3", "recset", 2, out error); dataListCompiler.PushBinaryDataList(_dl2.UID, _dl2, out _errors); //_compiler.UpsertSystemTag(dl2.UID, enSystemTag.EvaluateIteration, "true", out errors); }
public void Clone_50EntryRS_1kTimes_AtDepth() { string error; IBinaryDataList dl1 = Dev2BinaryDataListFactory.CreateDataList(GlobalConstants.NullDataListID); IList <Dev2Column> cols = new List <Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f2")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f3")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f4")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f5")); const int r = 50; const int runs = 1000; dl1.TryCreateRecordsetTemplate("recset", string.Empty, cols, true, out error); for (int i = 0; i < r; i++) { dl1.TryCreateRecordsetValue("r1.f1.value r1.f1.value r1.f1.valuer1.f1.valuer1.f1.value", "f1", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.value", "f3", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.value", "f4", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.value r1.f3.value v r1.f3.value r1.f3.value", "f5", "recset", (i + 1), out error); } DateTime start1 = DateTime.Now; string er; IBinaryDataListEntry val; bool tryGetEntry = dl1.TryGetEntry("recset", out val, out er); for (int q = 0; q < runs; q++) { if (tryGetEntry) { val.Clone(enTranslationDepth.Data, dl1.UID, out er); } } DateTime end1 = DateTime.Now; long ticks = (end1.Ticks - start1.Ticks); double result1 = (ticks / _ticksPerSec); Console.WriteLine(result1 + @" seconds for " + runs + @" to clone "); Assert.IsTrue(result1 <= 10.5); // Given .01 buffer ;) WAS : 0.065 }
public void LargeBDL_Create_1Mil_5Cols_Recordset_Entries() { string error; IBinaryDataList dl1 = Dev2BinaryDataListFactory.CreateDataList(GlobalConstants.NullDataListID); IList <Dev2Column> cols = new List <Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f2")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f3")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f4")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f5")); const int runs = 10000; dl1.TryCreateRecordsetTemplate("recset", string.Empty, cols, true, out error); using (dl1) { DateTime start1 = DateTime.Now; for (int i = 0; i < runs; i++) { dl1.TryCreateRecordsetValue("r1.f1.value r1.f1.value r1.f1.valuer1.f1.valuer1.f1.value", "f1", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.value", "f3", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.value", "f4", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.value r1.f3.value v r1.f3.value r1.f3.value", "f5", "recset", (i + 1), out error); } DateTime end1 = DateTime.Now; long ticks = (end1.Ticks - start1.Ticks); double result1 = (ticks / _ticksPerSec); Console.WriteLine(result1 + @" seconds for " + runs + @" with 5 cols"); Assert.IsTrue(result1 <= 1500, "Expected 500 seconds but got " + result1 + " seconds"); // Given 0.75 WAS : 0.75 // Since Windblow really sucks at resource allocation, I need to adjust these for when it is forced into a multi-user enviroment!!!! } }
public void DeSerializeToXMLFromBinary_InvertedIndexInsert_ValidXML_Expect_Sucess() { IBinaryDataList dl = Dev2BinaryDataListFactory.CreateDataList(); string error; List <Dev2Column> cols = new List <Dev2Column>(); ErrorResultTO errors; cols.Add(DataListFactory.CreateDev2Column("f1", "")); cols.Add(DataListFactory.CreateDev2Column("f2", "")); cols.Add(DataListFactory.CreateDev2Column("f3", "")); IDataListTranslator xmlConverter = Dls.GetTranslator(XmlFormat); dl.TryCreateRecordsetTemplate("rs1", "", cols, true, out error); dl.TryCreateScalarTemplate(string.Empty, "scalar1", "", true, out error); dl.TryCreateScalarValue("scalar1Value", "scalar1", out error); dl.TryCreateRecordsetValue("rec1.f2.vale", "f2", "rs1", 1, out error); dl.TryCreateRecordsetValue("rec1.f1.vale", "f1", "rs1", 1, out error); dl.TryCreateRecordsetValue("rec1.f3.vale", "f3", "rs1", 1, out error); dl.TryCreateRecordsetValue("rec2.f1.vale", "f1", "rs1", 2, out error); dl.TryCreateRecordsetValue("rec2.f2.vale", "f2", "rs1", 2, out error); dl.TryCreateRecordsetValue("rec2.f3.vale", "f3", "rs1", 2, out error); DataListTranslatedPayloadTO tmp = xmlConverter.ConvertFrom(dl, out errors); string result = tmp.FetchAsString().ToString(); Assert.AreEqual("<DataList><rs1><f1>rec1.f1.vale</f1><f2>rec1.f2.vale</f2><f3>rec1.f3.vale</f3></rs1><rs1><f1>rec2.f1.vale</f1><f2>rec2.f2.vale</f2><f3>rec2.f3.vale</f3></rs1><scalar1>scalar1Value</scalar1></DataList>", result); }
public void LargeBDL_Persist_1M_5Cols_Recordset_Entries() { string error; IBinaryDataList dl1 = Dev2BinaryDataListFactory.CreateDataList(GlobalConstants.NullDataListID); IList <Dev2Column> cols = new List <Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f2")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f3")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f4")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f5")); const int runs = 10000; //1000000; dl1.TryCreateRecordsetTemplate("recset", string.Empty, cols, true, out error); DateTime start1 = DateTime.Now; for (int i = 0; i < runs; i++) { dl1.TryCreateRecordsetValue("r1.f1.value r1.f1.value r1.f1.valuer1.f1.valuer1.f1.value", "f1", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.valuer1.f3.value", "f3", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.value", "f4", "recset", (i + 1), out error); dl1.TryCreateRecordsetValue("r1.f3.value r1.f3.value v r1.f3.value r1.f3.value", "f5", "recset", (i + 1), out error); } DateTime end1 = DateTime.Now; long ticks = (end1.Ticks - start1.Ticks); double result1 = (ticks / _ticksPerSec); Console.WriteLine(result1 + @" seconds for " + runs + @" with 5 cols"); Assert.IsTrue(result1 <= 2600, "Expected 600 seconds but got " + result1 + " seconds"); // create speed }
public void CloneWhereHasComplexExpressionAuditorExpectIsOnClonedObject() { //------------Setup for test-------------------------- string error; IBinaryDataList dl1 = Dev2BinaryDataListFactory.CreateDataList(GlobalConstants.NullDataListID); IList <Dev2Column> cols = new List <Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); dl1.TryCreateRecordsetTemplate("recset", string.Empty, cols, true, out error); dl1.TryCreateRecordsetValue("r1.f1.value r1.f1.value r1.f1.valuer1.f1.valuer1.f1.value", "f1", "recset", 1, out error); string er; IBinaryDataListEntry val; dl1.TryGetEntry("recset", out val, out er); val.ComplexExpressionAuditor = new ComplexExpressionAuditor(); //------------Execute Test--------------------------- IBinaryDataListEntry res = val.Clone(enTranslationDepth.Data, dl1.UID, out er); //------------Assert Results------------------------- Assert.IsNotNull(res.ComplexExpressionAuditor); }
public void MyTestInitialize() { string error; _dl1 = Dev2BinaryDataListFactory.CreateDataList(); _dl1.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl1.TryCreateScalarValue("myValue", "myScalar", out error); IList<Dev2Column> cols = new List<Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f2")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f3")); _dl1.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl1.TryCreateRecordsetValue("r1.f1.value", "f1", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f3.value", "f3", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r2.f1.value", "f1", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f2.value", "f2", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f3.value", "f3", "recset", 2, out error); // skip 3 ;) _dl1.TryCreateRecordsetValue("r4.f1.value", "f1", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f2.value", "f2", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f3.value", "f3", "recset", 4, out error); // create 2nd obj _dl2 = Dev2BinaryDataListFactory.CreateDataList(); _dl2.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl2.TryCreateScalarValue("myValue2", "myScalar", out error); cols = new List<Dev2Column> { Dev2BinaryDataListFactory.CreateColumn("f1"), Dev2BinaryDataListFactory.CreateColumn("f2"), Dev2BinaryDataListFactory.CreateColumn("f3") }; _dl2.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl2.TryCreateRecordsetValue("r1a.f1.value2", "f1", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1a.f2.value2", "f2", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1a.f3.value2", "f3", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r2a.f1.value2", "f1", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2a.f2.value2", "f2", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2a.f3.value2", "f3", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r3a.f1.value2", "f1", "recset", 3, out error); _dl2.TryCreateRecordsetValue("r3a.f2.value2", "f2", "recset", 3, out error); _dl2.TryCreateRecordsetValue("r3a.f3.value2", "f3", "recset", 3, out error); // create 3rd obj _dl3 = Dev2BinaryDataListFactory.CreateDataList(); _dl3.TryCreateScalarTemplate(string.Empty, "theScalar", "A scalar", true, out error); _dl3.TryCreateScalarValue("theValue", "theScalar", out error); cols = new List<Dev2Column> { Dev2BinaryDataListFactory.CreateColumn("f1"), Dev2BinaryDataListFactory.CreateColumn("f2"), Dev2BinaryDataListFactory.CreateColumn("f3") }; _dl3.TryCreateRecordsetTemplate("recset2", "a recordset", cols, true, out error); _dl3.TryCreateRecordsetValue("r1a.f1.value2", "f1", "recset2", 1, out error); _dl3.TryCreateRecordsetValue("r1a.f2.value2", "f2", "recset2", 1, out error); _dl3.TryCreateRecordsetValue("r1a.f3.value2", "f3", "recset2", 1, out error); _dl3.TryCreateRecordsetValue("r2a.f1.value2", "f1", "recset2", 2, out error); _dl3.TryCreateRecordsetValue("r2a.f2.value2", "f2", "recset2", 2, out error); _dl3.TryCreateRecordsetValue("r2a.f3.value2", "f3", "recset2", 2, out error); _dl3.TryCreateRecordsetValue("r3a.f1.value2", "f1", "recset2", 3, out error); _dl3.TryCreateRecordsetValue("r3a.f2.value2", "f2", "recset2", 3, out error); _dl3.TryCreateRecordsetValue("r3a.f3.value2", "f3", "recset2", 3, out error); // create 4th obj _dl4 = Dev2BinaryDataListFactory.CreateDataList(); _dl4.TryCreateScalarTemplate(string.Empty, "theScalar", "A scalar", true, out error); _dl4.TryCreateScalarValue("theValue4", "theScalar", out error); _dl4.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl4.TryCreateScalarValue("myValue4", "myScalar", out error); cols = new List<Dev2Column> { Dev2BinaryDataListFactory.CreateColumn("f1"), Dev2BinaryDataListFactory.CreateColumn("f2"), Dev2BinaryDataListFactory.CreateColumn("f3") }; _dl4.TryCreateRecordsetTemplate("recset2", "a recordset", cols, true, out error); _dl4.TryCreateRecordsetValue("r1a.f1.value2", "f1", "recset2", 1, out error); _dl4.TryCreateRecordsetValue("r1a.f2.value2", "f2", "recset2", 1, out error); _dl4.TryCreateRecordsetValue("r1a.f3.value2", "f3", "recset2", 1, out error); _dl4.TryCreateRecordsetValue("r2a.f1.value2", "f1", "recset2", 2, out error); _dl4.TryCreateRecordsetValue("r2a.f2.value2", "f2", "recset2", 2, out error); _dl4.TryCreateRecordsetValue("r2a.f3.value2", "f3", "recset2", 2, out error); _dl4.TryCreateRecordsetValue("r3a.f1.value2", "f1", "recset2", 3, out error); _dl4.TryCreateRecordsetValue("r3a.f2.value2", "f2", "recset2", 3, out error); _dl4.TryCreateRecordsetValue("r3a.f3.value2", "f3", "recset2", 3, out error); // create 5th obj _dlWithBankScalar = Dev2BinaryDataListFactory.CreateDataList(); _dlWithBankScalar.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dlWithBankScalar.TryCreateScalarValue("", "myScalar", out error); _dlWithPopulatedScalar = Dev2BinaryDataListFactory.CreateDataList(); _dlWithPopulatedScalar.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dlWithPopulatedScalar.TryCreateScalarValue("CAKE!", "myScalar", out error); }
public void MyTestInitialize() { string error; _dl1 = Dev2BinaryDataListFactory.CreateDataList(); _dl1.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl1.TryCreateScalarValue("myValue", "myScalar", out error); IList <Dev2Column> cols = new List <Dev2Column>(); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f1")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f2")); cols.Add(Dev2BinaryDataListFactory.CreateColumn("f3")); _dl1.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl1.TryCreateRecordsetValue("r1.f1.value", "f1", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f2.value", "f2", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r1.f3.value", "f3", "recset", 1, out error); _dl1.TryCreateRecordsetValue("r2.f1.value", "f1", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f2.value", "f2", "recset", 2, out error); _dl1.TryCreateRecordsetValue("r2.f3.value", "f3", "recset", 2, out error); // skip 3 ;) _dl1.TryCreateRecordsetValue("r4.f1.value", "f1", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f2.value", "f2", "recset", 4, out error); _dl1.TryCreateRecordsetValue("r4.f3.value", "f3", "recset", 4, out error); // create 2nd obj _dl2 = Dev2BinaryDataListFactory.CreateDataList(); _dl2.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl2.TryCreateScalarValue("myValue2", "myScalar", out error); cols = new List <Dev2Column> { Dev2BinaryDataListFactory.CreateColumn("f1"), Dev2BinaryDataListFactory.CreateColumn("f2"), Dev2BinaryDataListFactory.CreateColumn("f3") }; _dl2.TryCreateRecordsetTemplate("recset", "a recordset", cols, true, out error); _dl2.TryCreateRecordsetValue("r1a.f1.value2", "f1", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1a.f2.value2", "f2", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r1a.f3.value2", "f3", "recset", 1, out error); _dl2.TryCreateRecordsetValue("r2a.f1.value2", "f1", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2a.f2.value2", "f2", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r2a.f3.value2", "f3", "recset", 2, out error); _dl2.TryCreateRecordsetValue("r3a.f1.value2", "f1", "recset", 3, out error); _dl2.TryCreateRecordsetValue("r3a.f2.value2", "f2", "recset", 3, out error); _dl2.TryCreateRecordsetValue("r3a.f3.value2", "f3", "recset", 3, out error); // create 3rd obj _dl3 = Dev2BinaryDataListFactory.CreateDataList(); _dl3.TryCreateScalarTemplate(string.Empty, "theScalar", "A scalar", true, out error); _dl3.TryCreateScalarValue("theValue", "theScalar", out error); cols = new List <Dev2Column> { Dev2BinaryDataListFactory.CreateColumn("f1"), Dev2BinaryDataListFactory.CreateColumn("f2"), Dev2BinaryDataListFactory.CreateColumn("f3") }; _dl3.TryCreateRecordsetTemplate("recset2", "a recordset", cols, true, out error); _dl3.TryCreateRecordsetValue("r1a.f1.value2", "f1", "recset2", 1, out error); _dl3.TryCreateRecordsetValue("r1a.f2.value2", "f2", "recset2", 1, out error); _dl3.TryCreateRecordsetValue("r1a.f3.value2", "f3", "recset2", 1, out error); _dl3.TryCreateRecordsetValue("r2a.f1.value2", "f1", "recset2", 2, out error); _dl3.TryCreateRecordsetValue("r2a.f2.value2", "f2", "recset2", 2, out error); _dl3.TryCreateRecordsetValue("r2a.f3.value2", "f3", "recset2", 2, out error); _dl3.TryCreateRecordsetValue("r3a.f1.value2", "f1", "recset2", 3, out error); _dl3.TryCreateRecordsetValue("r3a.f2.value2", "f2", "recset2", 3, out error); _dl3.TryCreateRecordsetValue("r3a.f3.value2", "f3", "recset2", 3, out error); // create 4th obj _dl4 = Dev2BinaryDataListFactory.CreateDataList(); _dl4.TryCreateScalarTemplate(string.Empty, "theScalar", "A scalar", true, out error); _dl4.TryCreateScalarValue("theValue4", "theScalar", out error); _dl4.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dl4.TryCreateScalarValue("myValue4", "myScalar", out error); cols = new List <Dev2Column> { Dev2BinaryDataListFactory.CreateColumn("f1"), Dev2BinaryDataListFactory.CreateColumn("f2"), Dev2BinaryDataListFactory.CreateColumn("f3") }; _dl4.TryCreateRecordsetTemplate("recset2", "a recordset", cols, true, out error); _dl4.TryCreateRecordsetValue("r1a.f1.value2", "f1", "recset2", 1, out error); _dl4.TryCreateRecordsetValue("r1a.f2.value2", "f2", "recset2", 1, out error); _dl4.TryCreateRecordsetValue("r1a.f3.value2", "f3", "recset2", 1, out error); _dl4.TryCreateRecordsetValue("r2a.f1.value2", "f1", "recset2", 2, out error); _dl4.TryCreateRecordsetValue("r2a.f2.value2", "f2", "recset2", 2, out error); _dl4.TryCreateRecordsetValue("r2a.f3.value2", "f3", "recset2", 2, out error); _dl4.TryCreateRecordsetValue("r3a.f1.value2", "f1", "recset2", 3, out error); _dl4.TryCreateRecordsetValue("r3a.f2.value2", "f2", "recset2", 3, out error); _dl4.TryCreateRecordsetValue("r3a.f3.value2", "f3", "recset2", 3, out error); // create 5th obj _dlWithBankScalar = Dev2BinaryDataListFactory.CreateDataList(); _dlWithBankScalar.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dlWithBankScalar.TryCreateScalarValue("", "myScalar", out error); _dlWithPopulatedScalar = Dev2BinaryDataListFactory.CreateDataList(); _dlWithPopulatedScalar.TryCreateScalarTemplate(string.Empty, "myScalar", "A scalar", true, out error); _dlWithPopulatedScalar.TryCreateScalarValue("CAKE!", "myScalar", out error); }