Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Studio Unit test 2010

Status
Not open for further replies.

Badgers

Programmer
Nov 20, 2001
187
US
Hi,

I'm doing some unit tests and is it possible to call a method and check if a function from within has been called.

I think this is like Rhino mocks AssertWasCalled, is this possible with VS unit tests?

Thanks

Tim.
 
MS test is a testing framework, it makes assertions. similar to nunit, xunit and mbunit.
rhino mocks is a mocking framework, it creates fake objects for interfaces and abstract classes.
the 2 solve different problems. together they are a powerful combination to drive out the design of the system.

if you want to assert that a function was called you will need to use a mocking framework like Rhino.Mocks, Moq or TypeMock. Rhino.Mocks, Moq require abstactions (interface, abstract or virtual). TypeMock does not have this restriction. it can mock any type of object, including static types/members.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top