fixture.cs
来自「NHibernate NET开发者所需的」· CS 代码 · 共 50 行
CS
50 行
using System;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH296
{
[TestFixture]
public class Fixture : BugTestCase
{
public override string BugNumber
{
get { return "NH296"; }
}
[Test]
public void CRUD()
{
Stock stock = new Stock();
stock.ProductPK = new ProductPK();
stock.ProductPK.Number = 1;
stock.ProductPK.Type = 1;
using (ISession s = OpenSession())
{
s.Save(stock);
s.Flush();
}
using (ISession s = OpenSession())
{
stock = (Stock) s.Get(typeof(Stock), stock.ProductPK);
Assert.IsNotNull(stock);
}
using (ISession s = OpenSession())
{
stock = (Stock) s.Get(typeof(Product), stock.ProductPK);
Assert.IsNotNull(stock);
stock.Property = 10;
s.Flush();
}
using (ISession s = OpenSession())
{
s.Delete(stock);
s.Flush();
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?