Ejemplo n.º 1
0
 public void AdventureWorksIntegrationTest()
 {
     MappingGenerator gen = new MappingGenerator();
     gen.Configure(XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("NHibernate.Tool.hbm2net.Tests.Db2hbmTestAdventureWorks.xml")));
     internalStreams.Clear(); // clear all generated files...
     gen.Generate(this);
     foreach (var stream in internalStreams)
     {
         Console.WriteLine(stream.Key + ":");
         Console.WriteLine(stream.Value);
     }
 }
Ejemplo n.º 2
0
 public void BagCollection()
 {
     string hbm = "PropertiesAndBag.hbm.xml";
     TestHelper.BuildAssemblyFromHbm("NHibernate.DomainModel8", hbm);
     MappingGenerator gen = new MappingGenerator();
     gen.Configure(XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("NHibernate.Tool.hbm2net.Tests.Db2hbmTest8.xml")));
     string schema = GetSchemaForMSSql(hbm);
     Console.WriteLine("Generated Schema:");
     Console.Write(schema);
     internalStreams.Clear(); // clear all generated files...
     gen.Generate(this);
     Assert.IsTrue(internalStreams.ContainsKey("Simple"));
     Assert.IsTrue(internalStreams.ContainsKey("Item"));
     CheckXmlMapping(hbm, "Simple", "Item");
 }
Ejemplo n.º 3
0
 public void CanRunGenerator()
 {
     MappingGenerator gen = new MappingGenerator();
     gen.Configure(XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("NHibernate.Tool.hbm2net.Tests.Db2hbmConfigTemplate.xml")));
     gen.Generate(new StdoutStreamProvider());
 }
Ejemplo n.º 4
0
 public void UserBugNullRererenceWhenSmallIntIsKey()
 {
     CreateDbFromSchema("NHibernate.Tool.hbm2net.Tests.Schemas.UserBugNullRererenceWhenSmallIntIsKey.sql");
     MappingGenerator gen = new MappingGenerator();
     gen.Configure(XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("NHibernate.Tool.hbm2net.Tests.UserBugNullReferenceWhenSmallIntIsAKey.xml")));
     gen.Generate(new StdoutStreamProvider());
 }