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

Dummy class for the TeImporter so we can test it.
Inheritance: TeSfmImporter
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Public Properties

Property Type Description
m_SegmentMarkers List
s_consultantNoteDefn ICmAnnotationDefn
s_translatorNoteDefn ICmAnnotationDefn

Public Methods

Method Description
AddImportStyleProxyForMapping ( SIL.FieldWorks.FDO.Scripture.ImportMappingInfo mapping, ImportStyleProxy>.Dictionary styleProxies ) : void

Exposes the TeSfmImporter.AddImportStyleProxyForMapping method

AddTextToPara ( string sText, ITsTextProps pttpProps ) : void

Exposes the TeSfmImporter.AddTextToPara(string, ITsTextProps) method

FinalizeImport ( ) : void

Exposes the TeSfmImporter.FinalizeImport method

FindCorrespondingFootnote ( int ws, string styleId ) : IScrFootnote

Exposes the TeSfmImporter.FindCorrespondingFootnote(string) method

FindCorrespondingVernParaForSegment ( IStStyle style, SILUBS.SharedScrUtils.BCVRef targetRef, int iPara ) : IStTxtPara

Find a paragraph with the specified style id, containing the specified verse number, if specified, and having the correct sequence number. Sets all appropriate state variables before returning.

GetFootnote ( int iFootnoteIndex ) : IStFootnote

Get the requested footnote.

GetVerseRefAsString ( int wsBt ) : string

Exposes the TeSfmImporter.GetVerseRefAsString method.

Import ( ) : void

Exposes the TeImporter.Import method

Initialize ( ) : void

Exposes the TeSfmImporter.Initialize method

MakeParatextTestSettings ( IScrImportSet settings ) : void

Populate settings as if user had used the Import Wizard to choose a Paratext project and set up mappings.

MakeSFImportTestSettings ( IScrImportSet settings ) : void

Populate settings as if user had used the Import Wizard to choose a SF project and set up mappings appropriate for TOB data files.

ProcessSegment ( string sText, string sMarker ) : void

Exposes the TeSfmImporter.ProcessSegment method

SetUpMappings ( IScrImportSet settings ) : void

Set up appropriate mappings for the TEV and TOB data files.

StopImport ( ) : void

Simulates the user stopping an import.

VerifyAnnotationText ( IStText text, string fieldName, string expectedContents, int expectedWs ) : void

Verifies that StText field for an annotation was initialized properly.

VerifyInitializedNoteText ( IStText text, string fieldName ) : void

Verifies that StText field for an annotation was initialized properly.

VerifySimpleFootnote ( int iFootnoteIndex, string sFootnoteSegment, int iAutoNumberedFootnoteIndex, string sMarker, string sParaStyleName, int runCount ) : ITsString

Tests that a footnote has been created in the DB with a single default run having the specified text.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
CallFinalizePrevSection ( IScrSection section, ImportDomain prevImportDomain, bool fInScriptureText ) : void

Calls the FinalizePrevSection() method.

DummyTeImporter ( IScrImportSet settings, FdoTestBase testBase, FwStyleSheet styleSheet ) : System
InitScriptureObject ( ) : void

Method Details

AddImportStyleProxyForMapping() public method

Exposes the TeSfmImporter.AddImportStyleProxyForMapping method
public AddImportStyleProxyForMapping ( SIL.FieldWorks.FDO.Scripture.ImportMappingInfo mapping, ImportStyleProxy>.Dictionary styleProxies ) : void
mapping SIL.FieldWorks.FDO.Scripture.ImportMappingInfo The mapping for which the proxy entry is to be created
styleProxies ImportStyleProxy>.Dictionary Dictionary to add the proxy to
return void

AddTextToPara() public method

Exposes the TeSfmImporter.AddTextToPara(string, ITsTextProps) method
public AddTextToPara ( string sText, ITsTextProps pttpProps ) : void
sText string Text to be appended to the paragraph being built
pttpProps ITsTextProps Properties (should contain only a named style) for the run /// of text to be added.
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

FinalizeImport() public method

Exposes the TeSfmImporter.FinalizeImport method
public FinalizeImport ( ) : void
return void

FindCorrespondingFootnote() public method

Exposes the TeSfmImporter.FindCorrespondingFootnote(string) method
public FindCorrespondingFootnote ( int ws, string styleId ) : IScrFootnote
ws int The writing system of the current BT
styleId string style of footnote to find
return IScrFootnote

FindCorrespondingVernParaForSegment() public method

Find a paragraph with the specified style id, containing the specified verse number, if specified, and having the correct sequence number. Sets all appropriate state variables before returning.
public FindCorrespondingVernParaForSegment ( IStStyle style, SILUBS.SharedScrUtils.BCVRef targetRef, int iPara ) : IStTxtPara
style IStStyle style of paragraph to find
targetRef SILUBS.SharedScrUtils.BCVRef Reference to seek
iPara int 0-based index of paragraph
return IStTxtPara

GetFootnote() public method

Get the requested footnote.
public GetFootnote ( int iFootnoteIndex ) : IStFootnote
iFootnoteIndex int zero-based footnote index
return IStFootnote

GetVerseRefAsString() public method

Exposes the TeSfmImporter.GetVerseRefAsString method.
public GetVerseRefAsString ( int wsBt ) : string
wsBt int
return string

Import() public method

Exposes the TeImporter.Import method
public Import ( ) : void
return void

Initialize() public method

Exposes the TeSfmImporter.Initialize method
public Initialize ( ) : void
return void

MakeParatextTestSettings() static public method

Populate settings as if user had used the Import Wizard to choose a Paratext project and set up mappings.
static public MakeParatextTestSettings ( IScrImportSet settings ) : void
settings IScrImportSet The settings object to be populated
return void

MakeSFImportTestSettings() static public method

Populate settings as if user had used the Import Wizard to choose a SF project and set up mappings appropriate for TOB data files.
static public MakeSFImportTestSettings ( IScrImportSet settings ) : void
settings IScrImportSet The settings object to be populated
return void

ProcessSegment() public method

Exposes the TeSfmImporter.ProcessSegment method
public ProcessSegment ( string sText, string sMarker ) : void
sText string text to import
sMarker string standard format marker
return void

SetUpMappings() static public method

Set up appropriate mappings for the TEV and TOB data files.
static public SetUpMappings ( IScrImportSet settings ) : void
settings IScrImportSet The settings object to be set up
return void

StopImport() public method

Simulates the user stopping an import.
public StopImport ( ) : void
return void

VerifyAnnotationText() public method

Verifies that StText field for an annotation was initialized properly.
public VerifyAnnotationText ( IStText text, string fieldName, string expectedContents, int expectedWs ) : void
text IStText given StText
fieldName string name of field
expectedContents string Expected contents of (first and only) para (may be /// null)
expectedWs int Expected writing system ID (ignored if expectedContents is /// null)
return void

VerifyInitializedNoteText() public method

Verifies that StText field for an annotation was initialized properly.
public VerifyInitializedNoteText ( IStText text, string fieldName ) : void
text IStText given StText
fieldName string name of field
return void

VerifySimpleFootnote() public method

Tests that a footnote has been created in the DB with a single default run having the specified text.
public VerifySimpleFootnote ( int iFootnoteIndex, string sFootnoteSegment, int iAutoNumberedFootnoteIndex, string sMarker, string sParaStyleName, int runCount ) : ITsString
iFootnoteIndex int zero-based footnote index
sFootnoteSegment string Expected footnote contents
iAutoNumberedFootnoteIndex int zero-based index of this footnote /// in list of all auto-numbered footnotes. This could the be the third footnote /// overall, but only the second auto-numbered footnote.
sMarker string One of: "a", for automatic alpha sequence; "*", /// for a literal marker (we always use "*" in these tests); or string.Empty, /// for no marker
sParaStyleName string Name of the paragraph style
runCount int Number of runs expected in the footnote para
return ITsString

Property Details

m_SegmentMarkers public property

Tests can set this to simulate importing a sequence of segments
public List m_SegmentMarkers
return List

s_consultantNoteDefn public static property

public static ICmAnnotationDefn s_consultantNoteDefn
return ICmAnnotationDefn

s_translatorNoteDefn public static property

public static ICmAnnotationDefn s_translatorNoteDefn
return ICmAnnotationDefn