示例#1
0
        public void FullNameArgNull()
        {
            var csharp = new CSharpHelper();

            Assert.Throws <ArgumentNullException>("type",
                                                  () => { csharp.AppendFullNameTo(default(Type), new StringBuilder()); });
            Assert.Throws <ArgumentNullException>("typeName",
                                                  () => { csharp.AppendFullNameTo(typeof(int), default(StringBuilder)); });
            Assert.Throws <ArgumentNullException>("type",
                                                  () => { csharp.FullNameOf(default(Type)); });
        }
示例#2
0
        protected void AppendFullNameTo(string expected, Type type)
        {
            var csharp = new CSharpHelper();

            csharp.Import("System");
            csharp.Import("System.Threading");
            var typeName = new StringBuilder(type.FullName.Length);

            csharp.AppendFullNameTo(type, typeName);
            Assert.Equal(expected, typeName.ToString());
            typeName.Clear();
            csharp.AppendFullNameTo(type, typeName);
            Assert.Equal(expected, typeName.ToString());
        }