For example if I have following:
A<>--B<>--C<>--D how do you test map for D? Do you have to create
"statefull" test where you persist from root and then fetch when
testing next child in hierarchy. This might be an option since we are
testing mapping only, so maintaining state might be ok. Or do you use
some other strategy?
--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
On Dec 31, 8:28 am, Hudson Akridge <hudson.akri...@gmail.com> wrote:
> I honestly don't use the persistence specification for that. At some point,
> it becomes too cumbersome for me. In that kind of a scenario, I would test
> it natively. So build a model of A to B to C to D, persist, retrieve, and
> then assert my assumptions as needed from A to D.
>
> But perhaps others have better ways of doing it.
>
>
>
>
>
> On Wed, Dec 30, 2009 at 9:29 AM, epitka <exptrade2...@yahoo.com> wrote:
> > I am wondering what strategy others use in regards to testing deep
> > object graphs. I am especially interested in testing one-to-many with
> > non-nullable FK with cascade all-delete-orphan, but it applies to
> > other types as well.
>
> > For example if I have following:
>
> > A<>--B<>--C<>--D how do you test map for D? Do you have to create
> > "statefull" test where you persist from root and then fetch when
> > testing next child in hierarchy. This might be an option since we are
> > testing mapping only, so maintaining state might be ok. Or do you use
> > some other strategy?
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Fluent NHibernate" group.
> > To post to this group, send email to fluent-n...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > fluent-nhibern...@googlegroups.com<fluent-nhibernate%2Bunsubscr i...@googlegroups.com>
http://comparenetobjects.codeplex.com/
The problem is that it does a GetType() equality check so if you use
lazy loading, it'll grab the proxy type instead of the actual object
and return false. The 'fix' is to disable the GetType() check by
modifying the source, which causes it to compare the two graphs
correctly.