Also happens with Rhino.Mocks 3.5.0.1337.  My full configuration for
VS2K8 is as follows (sorry for the verbiage...):

Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1

Installed Edition: Professional

Microsoft Visual Basic 2008   91605-270-6598923-60340
Microsoft Visual Basic 2008

Microsoft Visual C# 2008   91605-270-6598923-60340
Microsoft Visual C# 2008

Microsoft Visual C++ 2008   91605-270-6598923-60340
Microsoft Visual C++ 2008

Microsoft Visual Studio 2008 Tools for Office
91605-270-6598923-60340
Microsoft Visual Studio 2008 Tools for Office

Microsoft Visual Web Developer 2008   91605-270-6598923-60340
Microsoft Visual Web Developer 2008

Crystal Reports    AAJ60-G0MSA4K-68000CF
Crystal Reports Basic for Visual Studio 2008


Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB944899)   KB944899
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/944899.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB945282)   KB945282
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/945282.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB946040)   KB946040
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946040.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB946308)   KB946308
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946308.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB946344)   KB946344
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946344.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB946581)   KB946581
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946581.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB947171)   KB947171
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947171.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB947173)   KB947173
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947173.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB947180)   KB947180
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947180.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB947540)   KB947540
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947540.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB947789)   KB947789
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947789.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB948127)   KB948127
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/948127.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB953256)   KB953256
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/953256.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB971092)   KB971092
This hotfix is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this hotfix will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/971092.

Microsoft Pex   0.15.40714.1
Microsoft Pex Visual Studio Extensions

Microsoft Stubs   1.0.0.0
Stubs generator for Visual Studio

Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1
(KB945140)   KB945140
This service pack is for Microsoft Visual Studio 2008 Professional
Edition - ENU.
If you later install a more recent service pack, this service pack
will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/945140.

Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1
(KB947888)   KB947888
This service pack is for Microsoft Visual Studio 2008 Professional
Edition - ENU.
If you later install a more recent service pack, this service pack
will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947888.

Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1
(KB948484)   KB948484
This service pack is for Microsoft Visual Studio 2008 Professional
Edition - ENU.
If you later install a more recent service pack, this service pack
will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/948484.

Security Update for Microsoft Visual Studio 2008 Professional Edition
- ENU (KB973675)   KB973675
This security update is for Microsoft Visual Studio 2008 Professional
Edition - ENU.
If you later install a more recent service pack, this security update
will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/973675.

Update for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB956453)   KB956453
This update is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this update will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/956453.

Update for Microsoft Visual Studio 2008 Professional Edition - ENU
(KB967143)   KB967143
This update is for Microsoft Visual Studio 2008 Professional Edition -
ENU.
If you later install a more recent service pack, this update will be
uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/967143.

VisualSVN   1.7.3
Integration with Subversion version control. For more information
about VisualSVN, see the VisualSVN website at http://www.visualsvn.com
Copyright (c) 2005-2008 VisualSVN Ltd.


On Sep 8, 10:22 am, Taylor906 <[email protected]> wrote:
> Rhino.Mocks 3.6.0.0.
>
> On the off-chance that MSTest has anything to do with it, I created a
> new WinForms application that references Rhino.Mocks.  No MSTest
> reference is used, no references to other unit test frameworks are
> used.  Pasted the test method below into the application; minus the
> [TestMethod] attribute and Assert call.  The code looks like this:
>
>         [STAThread]
>         static void Main()
>         {
>             AbuseArrayList_UsingCreateMockGenerics();
>
>             Application.EnableVisualStyles();
>             Application.SetCompatibleTextRenderingDefault(false);
>             Application.Run(new Form1());
>         }
>
>         static void AbuseArrayList_UsingCreateMockGenerics()
>         {
>             MockRepository mocks = new MockRepository();
>             ArrayList list = mocks.CreateMock<ArrayList>();
>
>             // Setup the expectation of a call on the mock
>             Expect.Call(list.Capacity).Return(999);
>             mocks.ReplayAll();
>
>             // Evaluate the values from the mock
>             int n = list.Capacity;
>             mocks.VerifyAll(); ;
>         }
>
> The same exception is thrown at Expect.Call(list.Capacity).  So, this
> is not a problem with MSTest.  I'll try downgrading to an earlier
> version of Rhino.Mocks to see what happens.
>
> On Sep 5, 10:24 am, Shawn Neal <[email protected]> wrote:
>
> > I just tried the same test using MSTest and it works fine.  I used the
> > ReSharper test runner as well as the one built into VS 2008, both passed.
> >  I'm using Rhino Mocks 3.5.0.1337, which version of RhinoMocks are you
> > using?
>
> > On Fri, Sep 4, 2009 at 6:13 PM, Tim Barcz <[email protected]> wrote:
> > > I believe this is a problem with MSTest.  The code as it sits below works
> > > for me in both NUnit and MbUnit.
>
> > > I don't use MSTest (to intrusive as this example demonstrates) so I cannot
> > > confirm but at this point this is the only difference I can see.
>
> > > Sorry, but you need to upgrade your testing platform
>
> > > On Thu, Sep 3, 2009 at 11:24 AM, Taylor906 <[email protected]> wrote:
>
> > >> I'm using VS2K8 Pro/.NET 3.5/MSTest, and I'm trying to get the
> > >> examples on the following Wiki page to work:
>
> > >>http://ayende.com/wiki/Rhino+Mocks+Mocking+classes.ashx
>
> > >> In particular, this example:
>
> > >>        [TestMethod]
> > >>        public void AbuseArrayList_UsingCreateMockGenerics()
> > >>        {
> > >>            Rhino.Mocks.MockRepository mocks = new
> > >> Rhino.Mocks.MockRepository();
> > >>            System.Collections.ArrayList list =
> > >> mocks.CreateMock<System.Collections.ArrayList>();
>
> > >>            // Setup the expectation of a call on the mock
> > >>            Rhino.Mocks.Expect.Call(list.Capacity).Return(999);
> > >>            mocks.ReplayAll();
>
> > >>            // Evaluate the values from the mock
> > >>            Assert.AreEqual(999, list.Capacity);
> > >>            mocks.VerifyAll();
> > >>        }
>
> > >> The test throws the following exception when setting the expectation
> > >> on the Capacity property:
>
> > >> Failed  AbuseArrayList_UsingCreateMockGenerics  TestProject1    Test
> > >> method
> > >> TestProject1.Class1Test.AbuseArrayList_UsingCreateMockGenerics threw
> > >> exception:  System.InvalidOperationException: Previous method
> > >> 'ArrayList.get_Count();' requires a return value or an exception to
> > >> throw..
>
> > >> Is there something obvious that I'm missing?  If not, do any of the
> > >> examples on this page actually work?
>
> > >> I can mock virtual methods of concrete classes with no problems; I am
> > >> only having problems with virtual properties of concrete classes, and/
> > >> or the examples on the Wiki.
>
> > > --
> > > Tim Barcz
> > > Microsoft ASPInsider
> > >http://timbarcz.devlicio.us
> > >http://www.twitter.com/timbarcz
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to