Did you know? DZone has great portals for Python, Cloud, NoSQL, and HTML5!

Alvin Ashcraft is Microsoft Visual C# MVP and .NET developer from the Philadelphia, PA area. He has more than 15 years of software development experience in the Health Care and Manufacturing industries. His wife and three daughters keep him occupied when he is not writing code. Alvin has posted 133 posts at DZone. View Full User Profile

Video: In The Brain of Abid Quereshi - Introduction to Moq

04.30.2009
Email
Views: 6552
  • submit to reddit

Your browser is not able to display this multimedia content.

Abid Quereshi introduces Moq, which is the only mocking library for .NET developed from scratch to take full advantage of .NET 3.5 and C# 3.0 features, providing a practical, unobtrusive and straight-forward way to quickly setup dependencies for your tests. It is relatively easier to learn and use than most of the other mock object frameworks.

The talk starts with a very short review about mocking, the difference between mocks and stubs and implementing Test-Driven Development (TDD) on the .Net platform. The project that Abid works on, and uses Moq during the development process, is about building a global shipping network system. The system includes objects like journeys, ports, and legs. How to create mocks from interfaces or existing classes in order to test these objects, and tips and pitfalls of using Moq to create those mocks are explained with hands-on demonstration.   

Version 3.0 RTM of Moq comes with key features like: Silverlight Support, New simplified event raising syntax, Support for custom event signatures, Improved property setter behaviour, Additional sample application code and Better integration with Pex. 

The project web site of Moq is: http://code.google.com/p/moq/. You can also find further information at the blog of Daniel Cazzulino, who is the primary author of Moq:http://www.clariusconsulting.net/blogs/kzu/archive/category/1062.aspx

 

Published at DZone with permission of its author, Alvin Ashcraft.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Hrady Ben replied on Fri, 2009/12/25 - 3:52am

c# is best oops programming language where we develop both windows and web application

Zetaclear

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.