Ejemplo n.º 1
0
        public void ShouldBeAbleToMockGenericMethod2()
        {
            Foo <int> retval = new Foo <int>();

            ILookupMapper <int> mapper = MockRepository.Mock <ILookupMapper <int> >();

            mapper.Expect(x => x.FindOneFoo())
            .Return(retval);

            Foo <int> oneFoo = mapper.FindOneFoo();

            mapper.VerifyExpectations(true);
        }
Ejemplo n.º 2
0
        public void ShouldBeAbleToMockGenericMethod()
        {
            List <Foo <int> > retval = new List <Foo <int> >();

            retval.Add(new Foo <int>());

            ILookupMapper <int> mapper = MockRepository.Mock <ILookupMapper <int> >();

            mapper.Expect(x => x.FindAllFoo())
            .Return(retval);

            IList <Foo <int> > listOfFoo = mapper.FindAllFoo();

            mapper.VerifyExpectations(true);
        }