Great question. I would inject stubs or mocks on the implemented methods to set up the test. So if I implement the IRFormScript interface like below. I could use a stub that implements the IRForm interface to setup expectations on the form object that gets injected into my methods. Some of these arguments are just strings too, so those are easy. You would also have to stub out any other interfaces to Pivotal in order to test your functionality without actually hitting the real system.(IRSystem7, DataAccess, etc.) Hope this helps! Brandon Joyce
public class TDD : Pivotal.Interop.RDALib.IRFormScript
{
public object AddFormData(Pivotal.Interop.RDALib.IRForm pForm, object Recordsets, ref object ParameterList)
{
throw new NotImplementedException();
}
public void DeleteFormData(Pivotal.Interop.RDALib.IRForm pForm, object RecordId, ref object ParameterList)
{
throw new NotImplementedException();
}
public void Execute(Pivotal.Interop.RDALib.IRForm pForm, string MethodName, ref object ParameterList)
{
throw new NotImplementedException();
}
public object LoadFormData(Pivotal.Interop.RDALib.IRForm pForm, object RecordId, ref object ParameterList)
{
throw new NotImplementedException();
}
public object NewFormData(Pivotal.Interop.RDALib.IRForm pForm, ref object ParameterList)
{
throw new NotImplementedException();
}
public void NewSecondaryData(Pivotal.Interop.RDALib.IRForm pForm, object SecondaryName, ref object ParameterList, ref Pivotal.Interop.ADODBLib.Recordset Recordset)
{
throw new NotImplementedException();
}
public void SaveFormData(Pivotal.Interop.RDALib.IRForm pForm, object Recordsets, ref object ParameterList)
{
throw new NotImplementedException();
}
public void SetSystem(Pivotal.Interop.RDALib.RSystem pSystem)
{
throw new NotImplementedException();
}
}