Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Facilities / NHibernateIntegration / Castle.Facilities.NHibernateIntegration.Tests / Common / TestInterceptor.cs
blobc0539265347b7329b5d60e938b705416256b130a
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 using NHibernate;
17 namespace Castle.Facilities.NHibernateIntegration.Tests.Common
19 /// <summary>
20 /// An implementation of the <see cref="IInterceptor"/> interface for testing
21 /// purposes.
22 /// </summary>
23 public class TestInterceptor : EmptyInterceptor
25 private bool onSaveCall;
26 private bool instantiationCall;
28 public bool ConfirmOnSaveCall()
30 return onSaveCall;
33 public bool ConfirmInstantiationCall()
35 return instantiationCall;
38 public void ResetState()
40 instantiationCall = false;
41 onSaveCall = false;
44 #region IInterceptor Members
46 public override int[] FindDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, NHibernate.Type.IType[] types)
48 return null;
51 public override object Instantiate(string clazz, EntityMode entityMode, object id)
53 instantiationCall = true;
54 return null;
57 public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, NHibernate.Type.IType[] types)
59 return false;
62 public override bool OnLoad(object entity, object id, object[] state, string[] propertyNames, NHibernate.Type.IType[] types)
64 return false;
67 public override bool OnSave(object entity, object id, object[] state, string[] propertyNames, NHibernate.Type.IType[] types)
69 onSaveCall = true;
70 return false;
73 public override void OnDelete(object entity, object id, object[] state, string[] propertyNames, NHibernate.Type.IType[] types)
77 public override void PreFlush(System.Collections.ICollection entities)
81 public override void PostFlush(System.Collections.ICollection entities)
85 #endregion