I am working off the trunk (rev 3778) and running the following
indicates that TransformTuple is being called but TransformList is not
being called. Before I submit a bug and patch with the following test
case, is this actually a bug or is it expected behaviour (or is my
test completely wrong)?
Currently when I run the test I get the following:
NUnit.Framework.AssertionException: Transform List was not called
Expected: True
But was: False
[Test]
public void
ExecutingCriteriaThroughMultiCriteriaTransformsResults()
{
CreateItems();
using( ISession session = OpenSession() )
{
ResultTransformerStub transformer = new
ResultTransformerStub();
ICriteria criteria =
session.CreateCriteria( typeof( Item ) )
.SetResultTransformer( transformer );
IMultiCriteria multiCriteria =
session.CreateMultiCriteria()
.Add( criteria );
IList results = multiCriteria.List();
Assert.IsTrue( transformer.WasTransformTupleCalled,
"Transform Tuple was not called" );
Assert.IsTrue(transformer.WasTransformListCalled,
"Transform List was not called");
}
RemoveAllItems();
}
public class ResultTransformerStub : IResultTransformer
{
private bool _wasTransformTupleCalled;
private bool _wasTransformListCalled;
public bool WasTransformTupleCalled
{
get { return _wasTransformTupleCalled; }
}
public bool WasTransformListCalled
{
get { return _wasTransformListCalled; }
}
public ResultTransformerStub( )
{
_wasTransformTupleCalled = false;
_wasTransformListCalled = false;
}
public object TransformTuple( object[] tuple, string[]
aliases )
{
_wasTransformTupleCalled = true;
return tuple;
}
public IList TransformList( IList collection )
{
_wasTransformListCalled = true;
return collection;
}
}
On Sep 23, 3:55 pm, "Ayende Rahien" <[EMAIL PROTECTED]> wrote:
> It was fixed about a week ago
>
> On Tue, Sep 23, 2008 at 4:53 AM, Neal Blomfield <[EMAIL PROTECTED]>wrote:
>
>
>
> > I have a reporting module that creates a number of detached queries,
> > assigns the appropriate result transformer and then adds all of the
> > detached criteria to a multicriteria.
>
> > Testing each of the detached criteria in isolation works as expected
> > (both TransformTuple and TransformList are called), however when I
> > test them using the multicriteria, only TransformTuple is called.
>
> > Is this expected behaviour or is it a bug?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---