public void StringCollectionTest() { var expectedResult = new List <string> { "Alpha", "beta", "gamma", "1", "2", "3", "4", "delta", "6", "longer_teeeeeextttttt" }; nameValueMap.Value["StringCollection"] = "Alpha, beta, gamma, 1, 2, 3, 4, delta, 6, longer_teeeeeextttttt"; IEnumerable <string> strCollection1 = nameValueMap.AsStringCollection("StringCollection"); Assert.Equal(expectedResult, strCollection1); }
public void RunWithArguments(Document doc, NameValueMap map) { LogTrace("Processing " + doc.FullFileName); try { // Using NameValueMapExtension if (map.HasKey("intIndex")) { int intValue = map.AsInt("intIndex"); LogTrace($"Value of intIndex is: {intValue}"); } if (map.HasKey("stringCollectionIndex")) { IEnumerable <string> strCollection = map.AsStringCollection("stringCollectionIndex"); foreach (string strValue in strCollection) { LogTrace($"String value is: {strValue}"); } } if (doc.DocumentType == DocumentTypeEnum.kPartDocumentObject) { using (new HeartBeat()) { // TODO: handle the Inventor part here } } else if (doc.DocumentType == DocumentTypeEnum.kAssemblyDocumentObject) // Assembly. { using (new HeartBeat()) { // TODO: handle the Inventor assembly here } } } catch (Exception e) { LogError("Processing failed. " + e.ToString()); } }