Ejemplo n.º 1
0
        public void LastIndexOfTest()
        {
            CLArguments indexOfList = this.Template.Clone();

            Assert.AreEqual(-1, indexOfList.LastIndexOf(NOT_EXIST_KEY),
                            "Found index for non-existing key");
            Assert.AreEqual(12, indexOfList.LastIndexOf(DUP_KEY),
                            "Invalid index of \"{0}\"" + DUP_KEY);
            Assert.AreEqual(3, indexOfList.LastIndexOf(DUP_KEY, 4),
                            "False index for second same key in IndexOf_string_int");
            Assert.AreEqual(12, indexOfList.LastIndexOf(DUP_KEY, 14, 3),
                            "False index for key in IndexOf_string_int_int");
            Assert.AreEqual(-1, indexOfList.LastIndexOf(DUP_KEY, 11, 5),
                            "Found index for existing key, but out of rage");
        }