예제 #1
0
        private void AssertValidDtoGraph(Detail detail, Master master, DetailCyclicDto dto)
        {
            dto.ShouldNotBeNull();
            detail.Id.ShouldBe(dto.Id);

            detail.Master.ShouldNotBeNull();
            master.Details.ShouldNotBeEmpty();
            detail.Master.Id.ShouldBe(master.Id);

            dto.Master.Details.Single().Id.ShouldBe(dto.Id, "Dto was not added to inner collection");
            //dto.GetHashCode().ShouldBe(dto.Master.Details.Single().GetHashCode()); // "Underlying provider always creates two distinct instances"
        }
예제 #2
0
        private void AssertValidDtoGraph(Detail detail, Master master, DetailCyclicDto dto)
        {
            dto.ShouldNotBeNull();
            detail.Id.ShouldEqual(dto.Id);

            detail.Master.ShouldNotBeNull();
            master.Details.ShouldNotBeEmpty();
            detail.Master.Id.ShouldEqual(master.Id);
            
            dto.Master.Details.Single().Id.ShouldEqual(dto.Id, "Dto was not added to inner collection");
            //dto.GetHashCode().ShouldEqual(dto.Master.Details.Single().GetHashCode()); // "Underlying provider always creates two distinct instances"
        }