Пример #1
0
        public void AnonymousType1()
        {
            NativeStruct nt = new NativeStruct();

            nt.IsAnonymous = true;
            Assert.False(string.IsNullOrEmpty(nt.Name));

            NativeSymbolBag bag = new NativeSymbolBag();

            bag.AddDefinedType(nt);
            Assert.True(NativeSymbolBag.IsAnonymousName(nt.Name));
        }
Пример #2
0
        private bool IsBadName(string name)
        {
            if (Regex.IsMatch(name, "^_\\w+$"))
            {
                return(true);
            }

            if (NativeSymbolBag.IsAnonymousName(name))
            {
                return(true);
            }

            return(false);
        }
Пример #3
0
 public void Anonymous2()
 {
     Assert.False(NativeSymbolBag.IsAnonymousName("foo"));
 }
Пример #4
0
        public void Anonymous1()
        {
            string name = NativeSymbolBag.GenerateAnonymousName();

            Assert.True(NativeSymbolBag.IsAnonymousName(name));
        }