namespace ChadSoft.Testing { using System; using System.IO; using System.IO.IsolatedStorage; using NUnit.Framework; /// /// Custom base class for deriving test fixtures from /// [TestFixture] public abstract class TestBase { private IsolatedStorageFile _FileStore; public IsolatedStorageFile FileStore { get { if(_FileStore == null) _FileStore = IsolatedStorageFile.GetUserStoreForDomain(); return _FileStore; } } public FileStream CreateFileStream(string path, FileMode mode) { return new IsolatedStorageFileStream(path, mode, FileStore); } [TestFixtureTearDown] public virtual void TestFixtureTearDown() { if(_FileStore != null) { _FileStore.Remove(); _FileStore.Close(); _FileStore.Dispose(); } } } }