Hi Patrick,
On Thu, Apr 28, 2011 at 8:20 PM, Patrick Steele
<[email protected]> wrote:
> What is MyMock1? What's the signature of MyMethod<T>?
In the meantime I did some other tests and a lot of things changed.
:-) Here is my "current" situation.
//wrapper for an EF ObjectContext or an NH ISession
public interface IDataContext : IDisposable
{
bool HasPendingChanges { get; }
void Add(object entity);
ITransaction BeginTransaction();
ITransaction BeginTransaction(System.Data.IsolationLevel isolation);
void Close();
bool Contains(object entity);
void Delete(object entity);
void Evict(object entity);
void FlushChanges();
T GetByKey<T>(object key);
IQueryable<T> Query<T>();
void Refresh(object entity);
void Update(object entity);
}
MockRepository repo = ...;
Foo foo = ...;
object id = ...;
var list = repo.StrictMock<List<Foo>>();
var dc = repo.StrictMock<IDataContext>();
//...;
using (repo.Ordered())
{
dc.Expect(item => item.GetByKey<Foo>(id)).Repeat.Once().Return(foo);
list.Expect(l => l.Contains(foo)).Repeat.Once().Return(true); //error
}
The detailed error is:
Type 'System.Boolean' doesn't match the return type 'Foo' for method
'IDataContext.GetByKey<Foo>(missing parameter);'
Thanks,
Giulio
--
--
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.