Esempio n. 1
0
        public void CanUseOutIntPtr()
        {
            MockRepository    mocks = new MockRepository();
            IFooWithOutIntPtr mock  = mocks.StrictMock <IFooWithOutIntPtr>();
            IntPtr            parameter;

            mock.GetBar(out parameter);
            LastCall.IgnoreArguments().Return(5).OutRef(new IntPtr(3));
            mocks.ReplayAll();
            Assert.Equal(5, mock.GetBar(out parameter));
            Assert.Equal(new IntPtr(3), parameter);
            mocks.VerifyAll();
        }
Esempio n. 2
0
        public void CanUseOutIntPtr()
        {
            IntPtr parameter;

            IFooWithOutIntPtr mock = MockRepository.Mock <IFooWithOutIntPtr>();

            mock.Expect(x => x.GetBar(out Arg <IntPtr> .Out(new IntPtr(3)).Dummy))
            .IgnoreArguments()
            .Return(5);

            Assert.Equal(5, mock.GetBar(out parameter));
            Assert.Equal(new IntPtr(3), parameter);
            mock.VerifyAllExpectations();
        }