Data Caching with Redis and C#

Summary Caching is a very large subject and I’m only going to dive into a small concept that uses Redis, an abstract caching class, and a dummy caching class for unit testing and show how to put it all together for a simple but powerful caching system. Caching Basics The type of caching I’m talking … Read moreData Caching with Redis and C#

Unit Testing Methods that Call Stored Procedures

Summary One of the biggest problems I used to find in unit testing is that most of the products I work on contain mostly methods that access a database. I found that most objects and methods work with data and it’s very tedious to try and mock or fake the database component. If you’ve followed … Read moreUnit Testing Methods that Call Stored Procedures

Entity Framework Unit Testing with SQLLocalDB

Summary I’ve published a few blog posts on the usage of SQLLocalDB with NHibernate. Now I’m going to demonstrate how easy it is to use with EF. In fact, SQLLocalDB can be used with ADO queries and LINQ-To-SQL. If you’re dealing with legacy code and your methods use a lot of database access operations, it … Read moreEntity Framework Unit Testing with SQLLocalDB

Fluent NHibernate Mapping Generator

Summary I finally did it. I completed my new Fluent NHibernate mapping generator. It has several features that make it more powerful than the hacked together console application that I did earlier this year. Included in this package are objects that use the generated code to create unit tests around SQLLocalDB. The Mapping Generator The … Read moreFluent NHibernate Mapping Generator

SQLLocalDB Fast Unit Tests

Summary One of my previous posts described how to setup a MS SQL Lite server called LocalDB. My little demo project worked really good except for one detail. It was slow. The primary problem was that I was starting the instance, creating the database in the unit test initialize (called [TestInitialize]) and then I was … Read moreSQLLocalDB Fast Unit Tests

Entity Framework 6 Mocking and Unit Testing

Last week I attempted to mimic this article from Microsoft: Testing and Mocking Framework.  I ran into a problem involving some code that was in the article last week, but has since been removed (I’m assuming that Microsoft changed something in their EF6 framework or .Net and didn’t update the article before I tested it).  … Read moreEntity Framework 6 Mocking and Unit Testing