public void CanMockGenericMethodInGenericClass() { GenericTestClass <string> t = MockRepository.Mock <GenericTestClass <string> >(); t.Expect(x => x.GenericMethod <int>("foo")) .Return(42); Assert.Equal(42, t.GenericMethod <int>("foo")); t.VerifyAllExpectations(); }
public void CanMockGenericMethodInGenericClass() { GenericTestClass <string> t = MockRepository.Mock <GenericTestClass <string> >(); t.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); t.Expect(x => x.GenericMethod <int>("foo")) .Return(42); Assert.Equal(42, t.GenericMethod <int>("foo")); t.VerifyAllExpectations(); }