jeudi 4 juin 2015

Unit Testing - How do I test this class

I have a Cache class (wraps System.Runtime.Caching.MemoryCache) that I have created which has the following public methods;

bool Add(string key, object value)
bool Contains(string key)

How do I test the Contains() method without using the Add() method in the first place to add an item to the Cache??? Surely if I use the Add() method within the unit test for the Contains() method this would be wrong?

Aucun commentaire:

Enregistrer un commentaire