BUY Anti-Bacterial Face Mask ONLINE WITHOUT PRESCRIPTION

June 29th, 2008

BUY Anti-Bacterial Face Mask ONLINE WITHOUT PRESCRIPTION, I finally got some time to look into Rhino Mocks 3.5 to see what is new.  Lets say there are some interesting extensions to the library.  OK, that was a bad pun that you probably didn't get.  A series of new extension methods were added.  Lets take a look.

Here is the list of some of the extension methods:

  • void AssertWasCalled<T>(this T mock, Action<T> action)
  • void AssertWasNotCalled<T>(this T mock, Action<T> action)
  • void BackToRecord<T>(this T mock)
  • IMethodOptions<VoidType> Expect<T>(this T mock, Action<T> action)
  • IList<object[]> GetArgumentsForCallsMadeOn<T>(this T mock, Action<T> action)
  • void Raise<TEventSource>(this TEventSource mockObject, Action<TEventSource> eventSubscription, params object[] args)
  • IMethodOptions<object> Stub<T>(this T mock, Action<T> action)

This is not a complete list, btw.  But these are the methods that I find interesting right now.  Plus, if you start looking at Ayende's new samples, you will need to keep these in mind.  Speaking of Ayende's samples, lets look at one.

   1: [Test]
   2: public void WhenUserForgetPasswordWillSendNotification_WithArgumentMatching()
   3: {
   4:     var userRepository = MockRepository.GenerateStub<IUserRepository>();
   5:     var notificationSender = MockRepository.GenerateStub<INotificationSender>();
   6:  
   7:     userRepository.Stub(x => x.GetUserById(5)).Return(new User { Id = 5, Name = "ayende" });
   8:  
   9:     new LoginController(userRepository, notificationSender).ForgotMyPassword(5);
  10:  
  11:     notificationSender.AssertWasCalled(x => x.Send("Changed password for ayende"));
  12: }

OK, first draw your attention to lines 4 and 5.  Note, there is nothing really new here.  We are creating a set of stub objects.  A stub object is a fake object that doesn't care if you call it or not.  Now, I'm trying to draw your attention to these lines, because it makes lines 7 and 11 more interesting.

On to line 7.  userRepository.Stub.  userRepository is a stubbed object (see line 4), that I am betting does not have a method called Stub.  It is an extension method from Rhino Mocks.  Here is what the online documentation says the Sub method does:

Tell the mock object to perform a certain action when a matching method is called. Does not create an expectation for this method.

OK, Anti-Bacterial Face Mask for sale, Fast shipping Anti-Bacterial Face Mask, so line 7 is telling userRepository that IF AND WHEN the userRepository method GetUserById is called for User 5, return a new User with an ID =5 and Name = "ayende".   Before, Anti-Bacterial Face Mask trusted pharmacy reviews, Where can i order Anti-Bacterial Face Mask without prescription, this would have looked like this:

MockRepository.Stub(userRepository.GetUserById(5)).Return(....)

Now it is

userRepository.Stub( x => x.GetUserById(5).Return(....)

There is a similar Expect extension method that does create an expectation.

There is still room for misunderstanding with this new syntax, but it could be a step in the right direction.  One of the problems I've had with Rhino Mocks, where can i buy cheapest Anti-Bacterial Face Mask online, Australia, uk, us, usa, and other Mocking frameworks is explaining the syntax to new users.  Namely, you don't see the mock object you are testing against first, buy Anti-Bacterial Face Mask online cod, Order Anti-Bacterial Face Mask online overnight delivery no prescription, but the method Expect or Stub.  Now the object is out front.  This will still cause a few issues -- especially for people who are not expecting extension methods, but I think that is just a small training issue.

Now on to line 11.

I'm looking at AssertWasCalled.  Note, buy cheap Anti-Bacterial Face Mask no rx, Purchase Anti-Bacterial Face Mask, this is called after the method ForgotMyPassword was called.  ForgotMyPassword is the method we are actually testing (also called the SUT, or system under test in unit testing lingo).

So, Anti-Bacterial Face Mask samples, Buy Anti-Bacterial Face Mask without a prescription, AssertWasCalled checks to see if the notification sender's Send method was called, and fail the test if it wasn't.  B-E-A-U-tiful.  This fixes one of the other major problems I've had explaining mocking, Anti-Bacterial Face Mask trusted pharmacy reviews, Online buying Anti-Bacterial Face Mask hcl, and it also made the tests harder to follow.  Here is why.

Typically in your test code you have two types of expectations.  Methods that you expect to call to get valuable information from so the SUT can continue, and methods that you expect to be called with that information.  Historically I've had to group both of those method calls together before the SUT is called.  That made things messy to me.  Plus things were all out of order.

The beauty of AssertWasCalled (and AssertWasNotCalled) is that they can be called AFTER the SUT is run.  Thus keeping everything in order and the coded easier to follow.

The big recap:

So here are the positive changes, Anti-Bacterial Face Mask from canadian pharmacy, Buy generic Anti-Bacterial Face Mask, as I see them:

  1. Mock/Stub objects come first when setting expectations
  2. You can check for values after the fact with AssertWasCalled and AssertWasNotCalled.

Thumbs up from me.

. Where can i find Anti-Bacterial Face Mask online. Buy Anti-Bacterial Face Mask from canada. Buy Anti-Bacterial Face Mask online cod. Where can i buy cheapest Anti-Bacterial Face Mask online. Where can i buy Anti-Bacterial Face Mask online. Buy no prescription Anti-Bacterial Face Mask online. Order Anti-Bacterial Face Mask from mexican pharmacy. Anti-Bacterial Face Mask price, coupon. Where to buy Anti-Bacterial Face Mask. Online buy Anti-Bacterial Face Mask without a prescription. Order Anti-Bacterial Face Mask online c.o.d. Buying Anti-Bacterial Face Mask online over the counter. Buy Anti-Bacterial Face Mask from mexico. Where can i order Anti-Bacterial Face Mask without prescription. Purchase Anti-Bacterial Face Mask online. Where to buy Anti-Bacterial Face Mask. Purchase Anti-Bacterial Face Mask ONLINE WITHOUT prescription. Buy cheap Anti-Bacterial Face Mask. Ordering Anti-Bacterial Face Mask online. Buy Anti-Bacterial Face Mask ONLINE WITHOUT prescription. Order Anti-Bacterial Face Mask from United States pharmacy. Australia, uk, us, usa. Anti-Bacterial Face Mask over the counter. Canada, mexico, india. Anti-Bacterial Face Mask gel, ointment, cream, pill, spray, continuous-release, extended-release. Buy cheap Anti-Bacterial Face Mask no rx. Rx free Anti-Bacterial Face Mask. Fast shipping Anti-Bacterial Face Mask. Kjøpe Anti-Bacterial Face Mask på nett, köpa Anti-Bacterial Face Mask online.

Similar posts: BUY Furosemide ONLINE WITHOUT PRESCRIPTION. BUY Vardenafil ONLINE WITHOUT PRESCRIPTION. Where can i find Shigru online. Australia, uk, us, usa.
Trackbacks from: BUY Anti-Bacterial Face Mask ONLINE WITHOUT PRESCRIPTION. BUY Anti-Bacterial Face Mask ONLINE WITHOUT PRESCRIPTION. Comprar en línea Anti-Bacterial Face Mask, comprar Anti-Bacterial Face Mask baratos. Online buy Anti-Bacterial Face Mask without a prescription. Buy generic Anti-Bacterial Face Mask.