public void WellFormedConfigurationWithNamedSessionFactory()
        {
            string xml =
                @"<nhs-configuration xmlns='urn:nhs-configuration-1.0'>
                      <search-factory sessionFactoryName='NHibernate.Test'>
                        <property name='hibernate.search.default.directory_provider'>NHibernate.Search.Storage.FSDirectoryProvider, NHibernate.Search</property>
		                    <property name='hibernate.search.default.indexBase'>/Index</property>
                      </search-factory>
                  </nhs-configuration>";

            XmlDocument cfgXml = new XmlDocument();

            cfgXml.LoadXml(xml);
            XmlTextReader       xtr           = new XmlTextReader(xml, XmlNodeType.Document, null);
            NHSConfigCollection cfgCollection = new NHSConfigCollection(xtr);

            Assert.AreEqual(1, cfgCollection.Count);
            Assert.IsTrue(cfgCollection.ContainsKey("NHibernate.Test"));

            INHSConfiguration cfg = cfgCollection.GetConfiguration("NHibernate.Test");

            Assert.AreEqual("NHibernate.Test", cfg.SessionFactoryName);
        }
        public void WellFormedConfigurationWithNamedSessionFactory()
        {
            string xml =
                @"<nhs-configuration xmlns='urn:nhs-configuration-1.0'>
                      <search-factory sessionFactoryName='NHibernate.Test'>
                        <property name='hibernate.search.default.directory_provider'>NHibernate.Search.Storage.FSDirectoryProvider, NHibernate.Search</property>
                            <property name='hibernate.search.default.indexBase'>/Index</property>
                      </search-factory>
              	  </nhs-configuration>";

            XmlDocument cfgXml = new XmlDocument();
            cfgXml.LoadXml(xml);
            XmlTextReader xtr = new XmlTextReader(xml, XmlNodeType.Document, null);
            NHSConfigCollection cfgCollection = new NHSConfigCollection(xtr);

            Assert.AreEqual(1, cfgCollection.Count);
            Assert.IsTrue(cfgCollection.ContainsKey("NHibernate.Test"));

            INHSConfiguration cfg = cfgCollection.GetConfiguration("NHibernate.Test");
            Assert.AreEqual("NHibernate.Test", cfg.SessionFactoryName);
        }