예제 #1
0
 public void Gribble_Commands_Should_Pick_Up_NHibernate_Command_Timeout()
 {
     using (var factory = CreateConfiguration(_database).BuildSessionFactory())
         using (var session = factory.OpenSession())
         {
             var connectionManager = new ConnectionManager(session);
             connectionManager.CreateCommand().CommandTimeout.ShouldEqual(CommandTimeout);
         }
 }
예제 #2
0
        public void Gribble_Should_Work_Without_A_Transaction_With_Nhibernate()
        {
            using (var factory = CreateConfiguration(_database).BuildSessionFactory())
                using (var session = factory.OpenSession())
                {
                    var connectionManager = new ConnectionManager(session);
                    var database          = TableSchema.Create(connectionManager);
                    database.CreateTable(TableName,
                                         new Column("id", typeof(int), key: Column.KeyType.PrimaryKey, isIdentity: true),
                                         new Column("name", typeof(string), length: 500));

                    var entity = new Entity {
                        Name = "Dirac"
                    };
                    session.Save(entity);
                }
        }