Does silverlight have Expression?

On Sat, May 16, 2009 at 8:50 AM, Paulsen <[email protected]> wrote:

>
> Hi,
>
> currently I am developing with the Composite Application Guidance for
> WPF and Silverlight.
> While testing I noticed that the method Arg<T>.Matches in Rhino Mocks
> has different layout in the Silverlight / .Net version.
>
> .Net:
> public static T Matches(Expression<Predicate<T>> predicate);
>
> Silverlight:
> public static T Matches<TPredicate>(Predicate<TPredicate> predicate);
>
> So writing
>
> obj.AssertWasCalled(x => x.PropertyChangedEventHandler
> (Arg<object>.Is.Anything, Arg<PropertyChangedEventArgs>.Matches(y =>
> y.PropertyName == "Property")));
>
> failed in Silverlight.
>
> I had to write
>
> Predicate<PropertyChangedEventArgs> pred = y => y.PropertyName ==
> "Property";
> obj.AssertWasCalled(x => x.PropertyChangedEventHandler
> (Arg<object>.Is.Anything, Arg<PropertyChangedEventArgs>.Matches
> (pred)));
>
> that failed to compile in non Silverlight environment.
>
> I would like to use one test code for both environments. Is this
> method layout difference a mistake?
>
> Thank you!
> Paulsen
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" 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/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to