Exemple #1
0
        public static void TestICodeRelated()
        {
            var a = new SampleIPhpStatement();

            Assert.True(a is ICodeRelated);

            var types = from assembly in AppDomain.CurrentDomain.GetAssemblies()
                        from type in assembly.GetTypes()
                        select type;

            foreach (var type in types)
            {
                var g = type.GetInterfaces();
                if (g.FirstOrDefault(q => q == typeof(IPhpStatement)) != null)
                {
                    if (g.FirstOrDefault(q => q == typeof(ICodeRelated)) == null)
                    {
                        throw new Exception(string.Format("type {0} implements IPhpStatement but not ICodeRequest", type));
                    }
                }
            }
        }
Exemple #2
0
        public static void TestICodeRelated()
        {
            var a = new SampleIPhpStatement();
            Assert.True(a is ICodeRelated);

            var types = from assembly in AppDomain.CurrentDomain.GetAssemblies()
                from type in assembly.GetTypes()
                select type;
            foreach (var type in types)
            {
                var g = type.GetInterfaces();
                if (g.FirstOrDefault(q => q == typeof (IPhpStatement)) != null)
                {
                    if (g.FirstOrDefault(q => q == typeof(ICodeRelated)) == null)
                    {
                        throw new Exception(string.Format("type {0} implements IPhpStatement but not ICodeRequest", type));
                    }
                }
            }

           
        }