public void GetDefaultConventions_should_return_conventions_for_each_configured_type()
        {
            var configurator =
                new TypeDefaultConventionConfigurator();

            configurator.ForType<string>();
            configurator.ForType<object>();

            var conventions =
                configurator.GetDefaultConventions();

            conventions.Count().ShouldEqual(2);
        }
示例#2
0
        public void GetDefaultConventions_should_return_conventions_for_each_configured_type()
        {
            var configurator =
                new TypeDefaultConventionConfigurator();

            configurator.ForType <string>();
            configurator.ForType <object>();

            var conventions =
                configurator.GetDefaultConventions();

            conventions.Count().ShouldEqual(2);
        }
        public void Configure(Action <ITypeDefaultConventionConfigurator> closure)
        {
            if (closure == null)
            {
                throw new ArgumentNullException("closure", "The closure cannot be null.");
            }

            var configurator =
                new TypeDefaultConventionConfigurator();

            closure(configurator);

            var conventions =
                configurator.GetDefaultConventions();

            this.DefaultConventions.AddRange(conventions);
        }
        public void Configure(Action<ITypeDefaultConventionConfigurator> closure)
        {
            if (closure == null)
            {
                throw new ArgumentNullException("closure", "The closure cannot be null.");
            }

            var configurator =
                new TypeDefaultConventionConfigurator();

            closure(configurator);

            var conventions =
                configurator.GetDefaultConventions();

            this.DefaultConventions.AddRange(conventions);
        }