Click here to Skip to main content
15,894,312 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 49.5K   94   50  
The article discusses how to isolate the code under test from behavior of referenced classes by using mocking frameworks.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Customers
{
    public class Customer
    {
        internal Customer()
        {
        }

        public int CustomerID { get; internal set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime DateOfBirth { get; set; }
    }
}

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