Ive been messing around with this and discovered that if i change the
code as follows, it works (note the lastcall added) im not really sure
why it works now but can verify that the test is sound by breaking it
on purpose. can anyone explain why it didnt work and now does and
whether this is the correct way to achieve what i want. its quite
confusing

         [Test]
         public void DownloadAttachesEventsWhenCreated()
         {
             MockRepository mocks = new MockRepository();
             Download dl = mocks.DynamicMock<Download>();
             DownloadEntity dle;
             With.Mocks(mocks).Expecting(delegate
             {
                 // Start Changed Code
                 dl.DownloadProgressChanged += null;
                 LastCall.Constraints(Is.NotNull());
                 // End Changed Code
             })
             .Verify(delegate
             {
                 // verify it is called by creating a new
DownloadEntity and injecting the mock
                 dle = new DownloadEntity(dl);
             });

         }

--~--~---------~--~----~------------~-------~--~----~
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