public void TestMethod1() { seat Seat = new seat(); NHibernateSample _sample = new NHibernateSample(NHibernateHelper.GetSession()); var tempTicket = new ticket(); tempTicket.id = "xulei789"; tempTicket.startpos = "庆"; tempTicket.endpos = "珠海"; tempTicket.ticketMoney = 50; tempTicket.time = "13:26"; tempTicket.totalseat = 100; tempTicket.remainseat = 100; tempTicket.date = "2012-05-15"; _sample.CreateTicket(tempTicket); ticket ticket2 = _sample.GetTicketById("zhazhu001"); int ticketMoney = ticket2.ticketMoney; Assert.AreEqual(60, ticketMoney); }
public void CreateSeat(seat Seat) { Session.Save(Seat); Session.Flush(); }