1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
20 public class ResourceImpl
: IResource
22 private bool _started
;
23 private bool _rolledback
;
24 private bool _committed
;
32 get { return _started; }
35 public bool Rolledback
37 get { return _rolledback; }
42 get { return _committed; }
45 #region IResource Members
47 public virtual void Start()
49 if (_started
) throw new ApplicationException("Start called before");
54 public virtual void Rollback()
56 if (_rolledback
) throw new ApplicationException("Rollback called before");
61 public virtual void Commit()
63 if (_committed
) throw new ApplicationException("Commit called before");