示例#1
0
        public void ParseDeclaringTypeOpt_should_handle_constructors_declaring_type(string text)
        {
            var s = new SignatureParser(text);

            s.MoveNext();
            string name;
            var    data = s.ParseDeclaringTypeOpt(out name);

            Assert.Equal("Hello", data.Name);
            Assert.Equal(text.Substring(1 + "Hello".Length), name);
            Assert.Equal(TokenType.EndOfInput, s.Type);
        }
示例#2
0
        public void ParseDeclaringTypeOpt_should_handle_unqualified_names(string text)
        {
            var s = new SignatureParser(text);

            s.MoveNext();
            string name;
            var    data = s.ParseDeclaringTypeOpt(out name);

            Assert.Null(data);
            Assert.Equal(text, name);
            Assert.Equal(TokenType.EndOfInput, s.Type);
        }
示例#3
0
        public void ParseDeclaringTypeOpt_should_extract_implied_generic_nested()
        {
            var s = new SignatureParser("System.Collections.Generic.Dictionary`2.ValueCollection.Method(");

            s.MoveNext();
            string name;
            var    data = s.ParseDeclaringTypeOpt(out name);

            Assert.Equal("Method", name);
            Assert.Equal("System.Collections.Generic.Dictionary`2+ValueCollection", data.FullName);
            Assert.Equal(TokenType.LeftParen, s.Type);
        }
示例#4
0
        public void ParseDeclaringTypeOpt_should_extract_declaring_alternate_nested_format()
        {
            var s = new SignatureParser("Hello/Other.World");

            s.MoveNext();
            string name;
            var    data = s.ParseDeclaringTypeOpt(out name);

            Assert.Equal("Hello+Other", data.FullName);
            Assert.Equal("World", name);
            Assert.Equal(TokenType.EndOfInput, s.Type);
        }
示例#5
0
        public void ParseDeclaringTypeOpt_should_extract_declaring(string declaring)
        {
            var s = new SignatureParser(declaring + ".World[");

            s.MoveNext();
            string name;
            var    data = s.ParseDeclaringTypeOpt(out name);

            Assert.Equal(declaring, data.FullName);
            Assert.Equal("World", name);
            Assert.Equal(TokenType.LeftBracket, s.Type);
        }