I am new to Rhino...
I have read this post: http://blog.tatham.oddie.com.au/2009/04/
in an attempt to mock up WCF calls from a silverlight application.
Here is the code: (sorry I dont know the code block syntax)
var expectedData = new ObservableCollection<X>
{
new X(){ Id=0, Name = "testName0"},
new X(){ Id=1, Name = "testName1"},
new X(){ Id=2, Name = "testName2"},
};
var mock = MockRepository.GenerateMock<IDalService>();
var asyncResult =
MockRepository.GenerateMock<IAsyncResult>();
mock.Expect(service => service.BeginGetXs(null, null)).re
.IgnoreArguments()
.Return(asyncResult);
mock.Expect(service => service.EndGetXs(asyncResult)).;
.Return(expectedData); // ERROR HERE
<---------------------------------------------------
var mainPageViewModel = new MainPageViewModel(mock);
mainPageViewModel.GetXsAsync();
var arguments = mock.GetArgumentsForCallsMadeOn(service =>
service.BeginGetClusterSources(null, null));
var callback = (AsyncCallback)arguments[0][0];
callback(asyncResult);
mock.VerifyAllExpectations();
asyncResult.VerifyAllExpectations();
At the ERROR HERE, I get
Argument 1: cannot convert from
'System.Collections.ObjectModel.ObservableCollection<X>' to
'System.Collections.ObjectModel.ObservableCollection`1<X>'
and if i hover over the area, I get
argument type 'System.Collections.ObjectModel.ObservableCollection<X>'
is not assignable to parameter type
'Rhino.Mocks.RhinoMocksExtensions.VoidType'
Does anyone know where I can look for a solution?
Cheers,
Jon
--
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.