Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 339fbfc8d3
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (45 sloc) 1.067 kB
using System.Linq;
using NHibernate.Linq;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH0000
{
[TestFixture]
public class Fixture : BugTestCase
{
protected override void OnSetUp()
{
using (var session = OpenSession())
using (var transaction = session.BeginTransaction())
{
var e1 = new Entity {Name = "Bob"};
session.Save(e1);
var e2 = new Entity {Name = "Sally"};
session.Save(e2);
session.Flush();
transaction.Commit();
}
}
protected override void OnTearDown()
{
using (var session = OpenSession())
using (var transaction = session.BeginTransaction())
{
session.Delete("from System.Object");
session.Flush();
transaction.Commit();
}
}
[Test]
public void YourTestName()
{
using (var session = OpenSession())
using (session.BeginTransaction())
{
var entities = (from e in session.Query<Entity>()
where e.Name == "Bob"
select e).ToList();
Assert.AreEqual(1, entities.Count);
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.