public void WithEntities() { System.Collections.IEnumerable persons = session.CreateCriteria(typeof(Person)).List <Person>(); Assert.AreEqual(2, session.CreateCriteria(typeof(Mail)) .Add(XmlIn.Create("To", persons, 1)) .List <Mail>() .Count); }
public void WithValues() { int[] persons = new int[] { 0, 1, 2 }; Assert.AreEqual(1, session.CreateCriteria(typeof(Mail)) .Add(XmlIn.Create("From.Id", persons, 1)) .List <Mail>() .Count); }
public void TwoXmlIn() { System.Collections.IEnumerable persons = session.CreateCriteria(typeof(Person)).List <Person>(); Assert.AreEqual(2, session.CreateCriteria(typeof(Mail)) .Add(Restrictions.And(XmlIn.Create("From", persons, 1), XmlIn.Create("To", persons, 1))) .List <Mail>().Count); }
public void WithEntitiesAndNoResults() { IList <Person> justBob = new List <Person>(); justBob.Add(bob); Assert.AreEqual(0, session.CreateCriteria(typeof(Mail)) .Add(XmlIn.Create("To", justBob)) .List <Mail>() .Count); }