Пример #1
0
        public void ModifyParialsumTestMethod()
        {
            int[]      array = { 3, 6, 5, 8, 7, 1, 6 };
            STDelegate st    = new STDelegate(array, (x, y) => Math.Min(x, y));

            st.Modify(5, -9);
            var res = st.Query(1, 5, int.MaxValue);

            Assert.AreEqual(-9, res);
        }
Пример #2
0
        public void ModifyParialsumTestMethod()
        {
            int[]      array = { 3, 6, 5, 8, 7, 1, 6 };
            STDelegate st    = new STDelegate(array, (x, y) => x * y);

            st.Modify(5, -9);
            var res = st.Query(1, 5, 1);

            Assert.AreEqual(6 * 5 * 8 * 7 * -9, res);
        }
Пример #3
0
        public void ModifySumAllTestMethod()
        {
            int[]      array = { 3, 6, 5, 8, 7, 1, 6 };
            STDelegate st    = new STDelegate(array, (x, y) => Math.Min(x, y));

            st.Modify(2, 10);
            var res = st.Query(0, array.Length - 1, int.MaxValue);

            Assert.AreEqual(1, res);
        }
Пример #4
0
        public void ModifySumAllTestMethod()
        {
            int[]      array = { 3, 6, 5, 8, 7, 1, 6 };
            STDelegate st    = new STDelegate(array, (x, y) => x * y);

            st.Modify(2, 10);
            var res = st.Query(0, array.Length - 1, 1);

            Assert.AreEqual(3 * 6 * 10 * 8 * 7 * 1 * 6, res);
        }