public void CanReportOneMatchingCriteria() { DetachedCriteria where = DetachedCriteria.For <Parent>() .Add(Expression.Eq("Name", "Parent1")); ParentDto dto = Repository <Parent> .ReportOne <ParentDto>(where, ProjectByNameAndAge); AssertDtoCreatedFrom(parentsInDb[0], dto); }
public void CanReportOneMatchingCriterion() { SimpleExpression whereName = Expression.Eq("Name", "Parent1"); SimpleExpression whereAge = Expression.Eq("Age", 100); ParentDto dto = Repository <Parent> .ReportOne <ParentDto>(ProjectByNameAndAge, whereName, whereAge); AssertDtoCreatedFrom(parentsInDb[0], dto); }
private static void AssertDtoCreatedFrom(Parent parent, ParentDto dto) { Assert.AreEqual(parent.Age, dto.Age); Assert.AreEqual(parent.Name, dto.Name); }