public void CanCreateTrulyDetachedQueryUsingStaticHelperWithoutParameters() { var query = DetachedFlowQuery.For <UserEntity>() .Where(x => x.Id == 1) .Select(x => x.Id); Assert.That(query, Is.Not.Null); Assert.That(((IFlowQuery)query).Options, Is.Null); Assert.That(((IFlowQuery)query).Alias, Is.EqualTo("this")); Assert.That(((IFlowQuery)query).CriteriaFactory, Is.Null); Assert.That(query.Criteria, Is.Not.Null); }
public void CanCreateTrulyDetachedQueryUsingStaticHelperWithOnlyAlias() { UserEntity user = null; var query = DetachedFlowQuery.For(() => user) .Where(x => x.Id == 1) .Select(x => x.Id); Assert.That(query, Is.Not.Null); Assert.That(((IFlowQuery)query).Options, Is.Null); Assert.That(((IFlowQuery)query).Alias, Is.EqualTo("user")); Assert.That(((IFlowQuery)query).CriteriaFactory, Is.Null); Assert.That(query.Criteria, Is.Not.Null); }