Example #1
0
 public void ShouldAssignArrayOfSetsToNative()
 {
     var intArray = new int[1][];
     intArray[0] = new int[1] { 2 };
     ISet<int>[] setArray = new HashSet<int>[1] { new HashSet<int> { 1 } };
     SinTDArray innerArray = new SinTDArray();
     innerArray.elementType = SinTDInstance.GetSinTDType("i32");
     SinTDArray outerArray = new SinTDArray();
     outerArray.elementType = innerArray;
     HashSet<int>[] test = (HashSet<int>[])outerArray.AssignValuesToNativeType(intArray, setArray.GetType());
     Assert.IsAssignableFrom<HashSet<int>>(test[0]);
     Assert.AreEqual(2, test[0].ElementAt(0));
 }
Example #2
0
 public void ShouldAssignArrayToNativeSet()
 {
     var intSet = new HashSet<int>();
     SinTDArray array = new SinTDArray();
     array.elementType = SinTDInstance.GetSinTDType("i32");
     ISet<int> test = (HashSet<int>)array.AssignValuesToNativeType(new int[1] { 1 }, intSet.GetType());
     Assert.AreEqual(1, test.Count);
     Assert.AreEqual(1, test.ElementAt(0));
 }
Example #3
0
 public void ShouldAssignLSetOfArraysToNative()
 {
     var intArray = new int[1][];
     intArray[0] = new int[1] { 2 };
     ISet<int[]> arraySet = new HashSet<int[]> { new int[1] { 1 } };
     SinTDArray innerArray = new SinTDArray();
     innerArray.elementType = SinTDInstance.GetSinTDType("i32");
     SinTDArray outerArray = new SinTDArray();
     outerArray.elementType = innerArray;
     ISet<int[]> test = (HashSet<int[]>)outerArray.AssignValuesToNativeType(intArray, arraySet.GetType());
     Assert.IsAssignableFrom<int[]>(test.ElementAt(0));
     Assert.AreEqual(2, test.ElementAt(0)[0]);
 }
Example #4
0
 static void Imprimir(HashSet<String> t)
 {
     Console.WriteLine("tipo: {0}", t.GetType().Name);
     Console.WriteLine("quantidade de elementos: {0}", t.Count);
 }