private void OnEnable()
    {
        // Initializing target
        _target = (ArrayModifier)target;
        // Initializing all the serialized properties
        _offsetType               = serializedObject.FindProperty("offsetType");
        _copiesCount              = serializedObject.FindProperty("CopiesCount");
        _offset                   = serializedObject.FindProperty("Offset");
        _useWorldSpace            = serializedObject.FindProperty("UseWorldSpace");
        _mergeSubMeshes           = serializedObject.FindProperty("MergeSubMeshes");
        _colliderOptions          = serializedObject.FindProperty("colliderOptions");
        _mergeIndipendentlyAction = serializedObject.FindProperty("mergeIndipendentlyAction");

        // Initializing the selected offset type local value
        _selectedOffsetType = _offsetType.enumValueIndex;
    }
Пример #2
0
        public void FilterDigitsTest()
        {
            DataRow[] datas           = TestContext.DataRow.GetChildRows("parameteres_TestCase1");
            string    stringArrayTest = Convert.ToString(TestContext.DataRow["array"]);

            string[] bufStrings = stringArrayTest.Split(',');
            int[]    testArray  = new int[bufStrings.Length];
            for (int i = 0; i < bufStrings.Length; i++)
            {
                testArray[i] = Convert.ToInt32(bufStrings[i]);
            }

            int testNumber = Convert.ToInt32(TestContext.DataRow["number"]);

            int[] actualArray   = ArrayModifier.FilterDigits(testArray, testNumber);
            int[] expectedArray = { 12, 12, 100 };
            CollectionAssert.AreEqual(actualArray, expectedArray);
        }
Пример #3
0
        protected override string Find(Image image)
        {
            var data = image.GetImage();

            data = FindMonsers(data);
            data = ArrayModifier.Rotate(data);
            data = FindMonsers(data);
            data = ArrayModifier.Rotate(data);
            data = FindMonsers(data);
            data = ArrayModifier.Rotate(data);
            data = FindMonsers(data);
            data.Reverse();
            data = FindMonsers(data);
            data = ArrayModifier.Rotate(data);
            data = FindMonsers(data);
            data = ArrayModifier.Rotate(data);
            data = FindMonsers(data);
            data = ArrayModifier.Rotate(data);
            data = FindMonsers(data);

            return($"{CountHashes(data)}");
        }
 public void FilterDigitsTest_WithNullPredicate()
 {
     Assert.Throws <ArgumentNullException>(() => ArrayModifier.FilterDigits(testArray, null));
 }
 public void FilterDigitsTest_WithNullArray()
 {
     Assert.Throws <ArgumentNullException>(() => ArrayModifier.FilterDigits(null, new PredicateNumberContainsDigit()));
 }
        public void FilterDigitsTest_NumberIsDividedByValue()
        {
            int[] expectedArray = { 13, -26, 0, -117 };

            CollectionAssert.AreEqual(expectedArray, ArrayModifier.FilterDigits(testArray, new PredicateNumberIsDividedByValue()));
        }
        public void FilterDigitsTest_NumberContainsDigit()
        {
            int[] expectedArray = { -1199, -90 };

            CollectionAssert.AreEqual(expectedArray, ArrayModifier.FilterDigits(testArray, new PredicateNumberContainsDigit()));
        }
        public void FilterDigitsTest_NumberIsPositive()
        {
            int[] expectedArray = { 13, 11, 14 };

            CollectionAssert.AreEqual(expectedArray, ArrayModifier.FilterDigits(testArray, new PredicateNumberIsPositive()));
        }
Пример #9
0
 public int[] FilterDigits_TestArray(int[] array, int number)
 {
     return(ArrayModifier.FilterDigits(array, number));
 }
Пример #10
0
 public void FilterDigits_NumberIsMoreThan9_ArgumentException()
 => Assert.Throws <ArgumentException>(() => ArrayModifier.FilterDigits(Array.Empty <int>(), 24));
Пример #11
0
 public void FilterDigits_Null_ArgumentNullException()
 => Assert.Throws <ArgumentNullException>(() => ArrayModifier.FilterDigits(null, 0));