Ejemplo n.º 1
0
        public void ShrinkTest()
        {
            string[] test;
            string[] expected;
            string[] actual;

            test     = new string[] { };
            actual   = ArrayExt.Shrink(test, 0, 0);
            expected = new string[] { };
            Assert.AreEqual(0, actual.Length);

            test     = new string[] { "Hi", "Bye" };
            actual   = ArrayExt.Shrink(test, 0, 1);
            expected = new string[] { "Hi", "Bye" };
            AssertEx.AreEqual(expected, actual);

            test     = new string[] { "Hi", "Bye" };
            actual   = ArrayExt.Shrink(test, 0, 0);
            expected = new string[] { "Hi" };
            AssertEx.AreEqual(expected, actual);

            test     = new string[] { "Hi", "Bye" };
            actual   = ArrayExt.Shrink(test, 1, 1);
            expected = new string[] { "Bye" };
            AssertEx.AreEqual(expected, actual);
        }