Ejemplo n.º 1
0
        public void CRefNameArgNull()
        {
            var csharp = new CSharpHelper();

            Assert.Throws <ArgumentNullException>("type",
                                                  () => { csharp.AppendCRefNameTo(default(Type), new StringBuilder()); });
            Assert.Throws <ArgumentNullException>("typeName",
                                                  () => { csharp.AppendCRefNameTo(typeof(int), default(StringBuilder)); });
            Assert.Throws <ArgumentNullException>("type",
                                                  () => { csharp.CRefNameOf(default(Type)); });
        }
Ejemplo n.º 2
0
        protected void AppendCRefNameTo(string expected, Type type)
        {
            var csharp = new CSharpHelper();

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

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