コード例 #1
0
        public void ParseParameterTypeOpt_should_handle_assembly_name(string text)
        {
            var s = new SignatureParser(text);

            s.MoveNext();
            var t = s.ParseParameterTypeOpt();

            Assert.NotNull(t.Assembly);
            Assert.Equal("mscorlib", t.Assembly.Name);
        }
コード例 #2
0
        public void ParseParameterTypeOpt_should_handle_generics(string text)
        {
            var s = new SignatureParser(text);

            s.MoveNext();

            var data = s.ParseParameterTypeOpt();

            Assert.NotNull(data);
            Assert.Equal(TypeName.Parse(text), data);
        }
コード例 #3
0
        public void ParseParameterTypeOpt_should_handle_arrays(string text, int dimensions)
        {
            var s = new SignatureParser(text);

            s.MoveNext();

            var data = s.ParseParameterTypeOpt();

            Assert.NotNull(data);
            Assert.True(data.IsArray);
            Assert.Equal(dimensions, ((ArrayTypeName)data).Dimensions.Count);
        }
コード例 #4
0
        public void ParseParameterTypeOpt_should_handle_nested(string text)
        {
            var s = new SignatureParser(text);

            s.MoveNext();
            var data = s.ParseParameterTypeOpt();

            Assert.NotNull(data);
            Assert.Equal("N.T+U", data.FullName);
            Assert.Equal("N", data.Namespace);
            Assert.Equal("U", data.Name);
            Assert.Equal("T", data.DeclaringType.Name);
        }