Unit Testing / Mocking Techniques

Introduction to Unit Testing Unit Testing The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect under various conditions. Benefits … [Read more...]

How to automate trimming strings in Entity Framework

When working with legacy data where the data being loaded into SQL server tables contains trailing spaces, the trailing spaces will remain in the fields regardless of whether the fields are varchar  This poses problems when doing compares or extracting data to files as you may not get the results … [Read more...]

Application Configuration Settings

One of the most common ways to store application setting is in the config file.  Below I will show examples of how to store configurations and their retrieval. AppSettings and ConnectionString Sections Include the appSettings and/or connectionStrings sections in  .config file for retrieval from … [Read more...]

Global Data

Global data is accessible anywhere in a program.   Using global data is riskier than using local data. Here are some common problems with using Global Data: Problems with Global Data Unexpected changes to global data.  Since global data can be accessed anywhere, it can also be changed … [Read more...]