C# Class SIL.FieldWorks.TE.ImportTests.DummyScrObjWrapper

Dummy class for the TeImporter so we can test it. The tests that use the DummyTeImporter do not utilize a scr obj to read real data files. We'll provide this dummy version of the ScrObjWrapper instead, to minimize our overhead.
Inheritance: ScrObjWrapper
Mostrar archivo Open project: sillsdev/FieldWorks Class Usage Examples

Public Properties

Property Type Description
m_CurrentWs int
m_SegmentMarkers List

Public Methods

Method Description
CurrentWs ( int defaultWs ) : int

Since the tests don't actually have a real text enumerator or real files, return a surreal writing sytem.

GetNextSegment ( string &sText, string &sMarker, ImportDomain &domain ) : bool

Advance the scripture text object enumerator to the next segment. This override allows us to test the condition where an unexpected exception occurs during import processing. If m_SegmentMarkers is set to a list of n segments, then this method will throw an exception when asked for segment n+1.

SetCurrentAnnotationType ( int hvoAnnotationType ) : void

Sets the type of the current annotation (to facilitate testing)

Protected Methods

Method Description
LoadParatextProject ( string paratextProjectId ) : void

For testing, this is a no-op

Method Details

CurrentWs() public method

Since the tests don't actually have a real text enumerator or real files, return a surreal writing sytem.
public CurrentWs ( int defaultWs ) : int
defaultWs int
return int

GetNextSegment() public method

Advance the scripture text object enumerator to the next segment. This override allows us to test the condition where an unexpected exception occurs during import processing. If m_SegmentMarkers is set to a list of n segments, then this method will throw an exception when asked for segment n+1.
public GetNextSegment ( string &sText, string &sMarker, ImportDomain &domain ) : bool
sText string Set to the text of the current segment
sMarker string Set to the marker of the current segment tag
domain ImportDomain Set to the domain of the stream being processed
return bool

LoadParatextProject() protected method

For testing, this is a no-op
protected LoadParatextProject ( string paratextProjectId ) : void
paratextProjectId string 3-letter Paratext project ID
return void

SetCurrentAnnotationType() public method

Sets the type of the current annotation (to facilitate testing)
public SetCurrentAnnotationType ( int hvoAnnotationType ) : void
hvoAnnotationType int HVO of the type of the current annotation.
return void

Property Details

m_CurrentWs public_oe property

Set this to simulate an import stream having a specific ICU Locale
public int m_CurrentWs
return int

m_SegmentMarkers public_oe property

Optional list of segment markers to process in a simulated import
public List m_SegmentMarkers
return List