Click here to Skip to main content
15,880,503 members
Articles / Programming Languages / C#

From Mocks to Isolation

Rate me:
Please Sign up or sign in to vote.
4.97/5 (19 votes)
31 Oct 2008CPOL16 min read 48.9K   94   50  
The article discusses how to isolate the code under test from behavior of referenced classes by using mocking frameworks.

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Customers", "Customers.csproj", "{29C6E22B-213A-4C66-B021-8843140AD192}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{658E4122-8E45-4A2A-A7F2-2BC31C89BD2D}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{29C6E22B-213A-4C66-B021-8843140AD192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{29C6E22B-213A-4C66-B021-8843140AD192}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{29C6E22B-213A-4C66-B021-8843140AD192}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{29C6E22B-213A-4C66-B021-8843140AD192}.Release|Any CPU.Build.0 = Release|Any CPU
		{658E4122-8E45-4A2A-A7F2-2BC31C89BD2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{658E4122-8E45-4A2A-A7F2-2BC31C89BD2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{658E4122-8E45-4A2A-A7F2-2BC31C89BD2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{658E4122-8E45-4A2A-A7F2-2BC31C89BD2D}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Miles AS
Norway Norway
Vagif Abilov is a Russian/Norwegian software developer and architect working for Miles. He has more than twenty years of programming experience that includes various programming languages, currently using mostly C# and F#.

Vagif writes articles and speaks at user group sessions and conferences. He is a contributor and maintainer of several open source projects, including Simple.Data OData adapter, Simple.OData.Client and MongOData.

Comments and Discussions