예제 #1
0
        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);
        }
예제 #2
0
        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);
 }
예제 #4
0
 private static void AssertDtoCreatedFrom(Parent parent, ParentDto dto)
 {
     Assert.AreEqual(parent.Age, dto.Age);
     Assert.AreEqual(parent.Name, dto.Name);
 }