Beispiel #1
0
        public void Exists()
        {
            Type       type   = typeof(LCIDConversionAttributeTests);
            MethodInfo method = type.GetTypeInfo().DeclaredMethods.Single(m => m.Name == "Func");
            LCIDConversionAttribute attribute = Assert.Single(method.GetCustomAttributes <LCIDConversionAttribute>(inherit: false));

            Assert.Equal(1337, attribute.Value);
        }
        public void CheckCurrentLCID()
        {
            MethodInfo mthIfo = this.GetType().GetMethod("IsValidLocale");
            Attribute  attr   = Attribute.GetCustomAttribute(mthIfo, typeof(LCIDConversionAttribute));

            if (attr != null)
            {
                LCIDConversionAttribute lcidAttr = (LCIDConversionAttribute)attr;
                Console.WriteLine("Position of the LCID argument in the unmanaged signature: " + lcidAttr.Value.ToString());
            }

            bool res = IsValidLocale(LCID_INSTALLED);

            Console.WriteLine("Result LCID_INSTALLED " + res.ToString());
            res = IsValidLocale(LCID_SUPPORTED);
            Console.WriteLine("Result LCID_SUPPORTED " + res.ToString());
        }
Beispiel #3
0
        public void Ctor_Lcid(int lcid)
        {
            var attribute = new LCIDConversionAttribute(lcid);

            Assert.Equal(lcid, attribute.Value);
        }