PageRenderTime 35ms CodeModel.GetById 32ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/UnitTests/BaseTestFixture.cs

http://github.com/philiplaureano/LinFu
C# | 33 lines | 27 code | 6 blank | 0 comment | 1 complexity | 00a56cab110e4347f6e5eecc2f1f32dc MD5 | raw file
 1
 2
 3using System;
 4
 5namespace LinFu.UnitTests
 6{
 7    public abstract class BaseTestFixture : IDisposable
 8    {
 9        private bool _disposed = false;
10        protected BaseTestFixture()
11        {
12            var self = this;
13            self.Init();
14        }
15
16        public virtual void Dispose()
17        {
18            if (!_disposed)
19            {
20                Term();
21                _disposed = true;
22            }
23        }
24
25        protected virtual void Init()
26        {
27        }
28
29        protected virtual void Term()
30        {
31        }
32    }
33}