missed a file.
[castle.git] / Services / Transaction / Castle.Services.Transaction.Tests / ResourceImpl.cs
blob61a702f0b40cb9b1c3dc844da2ac33e9eff51104
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.Services.Transaction.Tests
17 using System;
20 public class ResourceImpl : IResource
22 private bool _started;
23 private bool _rolledback;
24 private bool _committed;
26 public ResourceImpl()
30 public bool Started
32 get { return _started; }
35 public bool Rolledback
37 get { return _rolledback; }
40 public bool Committed
42 get { return _committed; }
45 #region IResource Members
47 public virtual void Start()
49 if (_started) throw new ApplicationException("Start called before");
51 _started = true;
54 public virtual void Rollback()
56 if (_rolledback) throw new ApplicationException("Rollback called before");
58 _rolledback = true;
61 public virtual void Commit()
63 if (_committed) throw new ApplicationException("Commit called before");
65 _committed = true;
68 #endregion