public void MWArray_ToArray_Double_to_Int_Test(double[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <int>(new MWNumericArray(item as Array)), Is.EquivalentTo(item.Select(i => Convert.ToInt32(i))));
 }
 public void MWArray_ToArray_Double_to_String_Test(double[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <string>(new MWNumericArray(item as Array)), Is.EquivalentTo(item.Select(i => i.ToString())));
 }
 public void MWArray_ToArray_Double_Test(double[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <double>(new MWNumericArray(item as Array)), Is.EquivalentTo(item));
 }
 public void MWArray_ToArray_Double_to_Bool_Test(double[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <bool>(new MWNumericArray(item as Array)), Is.EquivalentTo(item.Select(i => Convert.ToBoolean(i))));
 }
 public void MWArray_ToArray_Bool_to_String_Test(bool[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <string>(new MWLogicalArray(item as Array)), Is.EquivalentTo(item.Select(i => i.ToString())));
 }
Esempio n. 6
0
 public static void HundredMilionBoolItemsArray()
 {
     len       = hundredMilionBoolArray.Length;
     resultLen = MWArrayExtensions.ToArray <bool>(new MWLogicalArray(hundredMilionBoolArray as Array)).Length;
 }
 public void MWArray_ToArray_ArgumentException_Test()
 {
     Assert.That(() => MWArrayExtensions.ToArray <int>(null), Throws.ArgumentNullException);
     Assert.That(() => MWArrayExtensions.ToArray <double>(MWStructArray.Empty), Throws.ArgumentException);
 }
 public void MWArray_ToArray_Bool_Test(bool[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <bool>(new MWLogicalArray(item as Array)), Is.EquivalentTo(item));
 }
 public static void HundredThousandDoubleItemsArray()
 {
     len       = hundredThousandDoubleArray.Length;
     resultLen = MWArrayExtensions.ToArray <double>(new MWNumericArray(hundredThousandDoubleArray as Array)).Length;
 }
 public static void MilionDoubleItemsArray()
 {
     len       = milionDoubleArray.Length;
     resultLen = MWArrayExtensions.ToArray <double>(new MWNumericArray(milionDoubleArray as Array)).Length;
 }
 public static void HundredMilionIntItemsArray()
 {
     len       = hundredMilionIntArray.Length;
     resultLen = MWArrayExtensions.ToArray <int>(new MWNumericArray(hundredMilionIntArray as Array)).Length;
 }
 public static void TenMilionIntItemsArrayWitchChangeTypeToDouble()
 {
     len       = tenMilionIntArray.Length;
     resultLen = MWArrayExtensions.ToArray <double>(new MWNumericArray(tenMilionIntArray as Array)).Length;
 }
 public static void TenMilionDoubleItemsArrayWithChangeTypeToInt()
 {
     len       = tenMilionDoubleArray.Length;
     resultLen = MWArrayExtensions.ToArray <int>(new MWNumericArray(tenMilionDoubleArray as Array)).Length;
 }
        public void MWArray_ToArray_BigArray_Double_Test()
        {
            var largeItem = Enumerable.Range(-5000, 5000).Select(i => (double)i).ToArray();

            Assert.That(MWArrayExtensions.ToArray <double>(new MWNumericArray(largeItem as Array)), Is.EquivalentTo(largeItem));
        }
 public void MWArray_ToArray_Int_Test(int[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <int>(new MWNumericArray(item as Array)), Is.EquivalentTo(item));
 }
 public void MWArray_ToArray_Empty_Bool_Test()
 {
     Assert.That(MWArrayExtensions.ToArray <bool>(new MWLogicalArray()), Is.EquivalentTo(Array.Empty <bool>()));
 }
        public void MWArray_ToArray_BigArray_Int_Test()
        {
            var largeItem = Enumerable.Range(-5000, 5000).ToArray();

            Assert.That(MWArrayExtensions.ToArray <int>(new MWNumericArray(largeItem as Array)), Is.EquivalentTo(largeItem));
        }
 public void MWArray_ToArray_Bool_to_Double_Test(bool[] item)
 {
     Assert.That(MWArrayExtensions.ToArray <double>(new MWLogicalArray(item as Array)), Is.EquivalentTo(item.Select(i => Convert.ToDouble(i))));
 }
 public void MWArray_ToArray_Empty_Double_Test()
 {
     Assert.That(MWArrayExtensions.ToArray <double>(new MWNumericArray()), Is.EquivalentTo(Array.Empty <double>()));
 }
        public void MWArray_ToArray_BigArray_Bool_Test()
        {
            var largeItem = Enumerable.Range(-50000, 50000).Select(i => true).ToArray();

            Assert.That(MWArrayExtensions.ToArray <bool>(new MWLogicalArray(largeItem as Array)), Is.EquivalentTo(largeItem));
        }
Esempio n. 21
0
 public static void TenMilionBoolItemsArrayWithChangeToString()
 {
     len       = tenMilionBoolArray.Length;
     resultLen = MWArrayExtensions.ToArray <string>(new MWLogicalArray(tenMilionBoolArray as Array)).Length;
 }