public void All_declarations_not_under_an_internal_or_resources_namespace_are_public_or_nested()
        {
            List<Assembly> assemblies = GetAssembliesUnderTest().ToList();
            assemblies.Count.ShouldBeGreaterThan(0);

            var violatingTypes = new HashSet<Type>();

            foreach (Assembly asm in assemblies)
            {
                List<Type> allAssemblyTypes = asm.GetTypes().ToList();
                foreach (Type type in allAssemblyTypes)
                {
                    string namespaceName = type.Namespace ?? string.Empty;
                    if (namespaceName.Length == 0)
                    {
                        // skip anonymous types.
                        continue;
                    }

                    if (namespaceName == "JetBrains.Profiler.Core.Instrumentation" && type.Name == "DataOnStack")
                    {
                        // appears when performing test coverage using dotCover.
                        continue;
                    }

                    if (!namespaceName.Contains(".Internal") && !namespaceName.Contains(".Resources") && !type.IsPublic && !type.IsNested)
                    {
                        violatingTypes.Add(type);
                    }
                }
            }

            violatingTypes.ShouldContainOnly(new Type[] { });
        }
        public void All_declarations_under_an_internal_namespace_are_not_public()
        {
            List<Assembly> assemblies = GetAssembliesUnderTest().ToList();
            assemblies.Count.ShouldBeGreaterThan(0);

            var violatingTypes = new HashSet<Type>();

            foreach (Assembly asm in assemblies)
            {
                List<Type> allAssemblyTypes = asm.GetTypes().ToList();
                foreach (Type type in allAssemblyTypes)
                {
                    string namespaceName = type.Namespace ?? string.Empty;
                    if (namespaceName.Contains(".Internal") && type.IsPublic)
                    {
                        violatingTypes.Add(type);
                    }
                }
            }

            violatingTypes.ShouldContainOnly(new Type[] { });
        }