Ejemplo n.º 1
0
        public void DeclarationsGetGlyph_BadIndex()
        {
            Declarations declarations = CreateDeclarations();

            CheckDeclarationsLimit <int> .GetObjectFunction getGlyph =
                new CheckDeclarationsLimit <int> .GetObjectFunction(declarations.GetGlyph);

            Assert.IsTrue(CheckDeclarationsLimit <int> .CheckIndexException(getGlyph, 0));
            Assert.IsTrue(CheckDeclarationsLimit <int> .CheckIndexException(getGlyph, -1));
            Assert.IsTrue(CheckDeclarationsLimit <int> .CheckIndexException(getGlyph, 1));

            AddMethod(declarations, "Test");
            Assert.IsFalse(CheckDeclarationsLimit <int> .CheckIndexException(getGlyph, 0));
            Assert.IsTrue(CheckDeclarationsLimit <int> .CheckIndexException(getGlyph, -1));
            Assert.IsTrue(CheckDeclarationsLimit <int> .CheckIndexException(getGlyph, 1));
        }
Ejemplo n.º 2
0
        public void DeclarationsGetDescription_BadIndex()
        {
            Declarations declarations = CreateDeclarations();

            CheckDeclarationsLimit <string> .GetObjectFunction getString =
                new CheckDeclarationsLimit <string> .GetObjectFunction(declarations.GetDescription);

            Assert.IsTrue(CheckDeclarationsLimit <string> .CheckIndexException(getString, 0));
            Assert.IsTrue(CheckDeclarationsLimit <string> .CheckIndexException(getString, -1));
            Assert.IsTrue(CheckDeclarationsLimit <string> .CheckIndexException(getString, 1));

            AddMethod(declarations, "Test");
            Assert.IsFalse(CheckDeclarationsLimit <string> .CheckIndexException(getString, 0));
            Assert.IsTrue(CheckDeclarationsLimit <string> .CheckIndexException(getString, -1));
            Assert.IsTrue(CheckDeclarationsLimit <string> .CheckIndexException(getString, 1));
        }