public void WithGenericMethods() { MockRepository mocks = new MockRepository(); IFunkyList <int> list = mocks.DynamicMock <IFunkyList <int> >(); Assert.NotNull(list); List <Guid> results = new List <Guid>(); Expect.Call(list.FunkItUp <Guid>(null, null)) .IgnoreArguments() .Constraints(Is.Equal("1"), Is.Equal(2)) .Return(results); mocks.ReplayAll(); Assert.Same(results, list.FunkItUp <Guid>("1", 2)); }
public void WithGenericMethods() { List <Guid> results = new List <Guid>(); IFunkyList <int> list = MockRepository.Mock <IFunkyList <int> >(); Assert.NotNull(list); list.Expect(x => x.FunkItUp <Guid>(Arg.Is("1"), Arg.Is(2))) .Return(results); Assert.Same(results, list.FunkItUp <Guid>("1", 2)); }