Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


Asserting a mock with test framework

AddThis Social Bookmark Button
When asserting an expected call for its number of occurrences or may be just to verify if the setup/arrange is acted as intended, the tool generally raises assertion that points us to the reason why the test failed. Different mocking tools use different exception classes therefore there is no common way to consolidate them. However, if we just take a look into the test framework unless its some alien one, they all have a common underlying structure for Assert.Throws or ExpectedException (MSTest). MS Test (C# and Silverlight)
Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException NUnit NUnit.Framework.AssertionException XUnit Xunit.Sdk.AssertException MSpec Machine.Specifications.SpecificationException MbUnit Gallio.Framework.Assertions.AssertionException So the point here is that if we just use the existing exception class rather than thinking one of our own, it greatly increases the scope of...(Read whole news on source site)

Home : Blog List : Mehfuz's WebLog : Asserting a mock with test framework