C# Class SIL.FieldWorks.FDO.FDOTests.MemoryOnlyBackendProviderRestoredForEachTestTestBase

Base class for testing the FdoCache with the FDOBackendProviderType.kMemoryOnly backend provider where each test should start with an 'almost' fresh system. It is 'almost' a fresh system, since it doesn't actually create a new FDO system for every test. It just loops through Undo as long as possible "MemoryOnlyUndoForEachTestBase "
Mostrar archivo Open project: sillsdev/FieldWorks

Public Methods

Method Description
AddInterlinearTextToLangProj ( string name ) : IText

Adds an interlinear text to the language projectin the mocked fdocache

AddInterlinearTextToLangProj ( string name, bool fCreateContents ) : IText

Adds an interlinear text to the language projectin the mocked fdocache

AddParaToInterlinearTextContents ( IText itext, string paraText ) : IStTxtPara

Adds a paragraph with the specified text to the given interlinear text

AddRunToMockedPara ( IStTxtPara para, string runText, int ws ) : void

Adds a run of text to the specified paragraph

AddRunToMockedPara ( IStTxtPara para, string runText, string runStyleName ) : void

Adds a run of text to the specified paragraph

AddStyle ( IFdoOwningCollection styleList, string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, int userLevel, bool isBuiltIn ) : IStStyle

Create a new style on the specified style list.

AddTestStyle ( string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, IFdoOwningCollection styleCollection ) : IStStyle

Create a new style and add it to the Language Project stylesheet.

AddTestStyle ( string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, int userLevel, IFdoOwningCollection styleCollection ) : IStStyle

Create a new style and add it to the Language Project stylesheet.

AppendRunToBt ( IStTxtPara para, int ws, string runText ) : void

Append a run of text to a back translation of a paragraph.

TestSetup ( ) : void

Override to start an undoable UOW.

TestTearDown ( ) : void

Override to end the undoable UOW, Undo everything, and 'commit', which will essentially clear out the Redo stack.

Protected Methods

Method Description
AddBtToMockedParagraph ( IStTxtPara owner, int wsTrans ) : ICmTranslation

Add an empty back translation to the paragraph, or return the existing one.

AddParaToMockedText ( IStText owner, string paraStyleName ) : IStTxtPara

Add an empty but properly initialized (with WS) content paragraph to the specified StText in the mock fdocache

AddRunToMockedTrans ( ICmTranslation trans, int btWS, int runWS, string runText, string runStyleName ) : void

Adds a run of text to the specified translation

AddRunToMockedTrans ( ICmTranslation trans, int btWS, string runText, string runStyleName ) : void

Adds a run of text to the specified translation

AddRunToSegmentFt ( IStTxtPara para, int iSeg, string freeTrans, string styleName ) : void

Adds a run to the free translation of the specified segment of the specified paragraph having the specified style in the default analysis writing system.

AddSegmentFt ( IStTxtPara para, int iSeg, string freeTrans ) : void

Adds a free translation to the specified segment of the specified paragraph for the specified writing systems.

ChangeDefaultAnalWs ( IWritingSystem ws ) : void

Change the default analysis writing system. (This removes any previous "current" analysis writing system(s) from the list.) This also ensures that the given WS is in the list of all analysis WSs.

CreateTestData ( ) : void

Creates the test data.

UndoAll ( ) : void

End the undoable UOW and Undo everything.

Method Details

AddBtToMockedParagraph() protected method

Add an empty back translation to the paragraph, or return the existing one.
protected AddBtToMockedParagraph ( IStTxtPara owner, int wsTrans ) : ICmTranslation
owner IStTxtPara the owning paragraph
wsTrans int
return ICmTranslation

AddInterlinearTextToLangProj() public method

Adds an interlinear text to the language projectin the mocked fdocache
public AddInterlinearTextToLangProj ( string name ) : IText
name string The name (in English).
return IText

AddInterlinearTextToLangProj() public method

Adds an interlinear text to the language projectin the mocked fdocache
public AddInterlinearTextToLangProj ( string name, bool fCreateContents ) : IText
name string The name (in English).
fCreateContents bool if set to true also creates an StText for the /// Contents.
return IText

AddParaToInterlinearTextContents() public method

Adds a paragraph with the specified text to the given interlinear text
public AddParaToInterlinearTextContents ( IText itext, string paraText ) : IStTxtPara
itext IText The itext.
paraText string Paragraph contents.
return IStTxtPara

AddParaToMockedText() protected method

Add an empty but properly initialized (with WS) content paragraph to the specified StText in the mock fdocache
protected AddParaToMockedText ( IStText owner, string paraStyleName ) : IStTxtPara
owner IStText the hvo of the StText
paraStyleName string the paragraph style name
return IStTxtPara

AddRunToMockedPara() public method

Adds a run of text to the specified paragraph
public AddRunToMockedPara ( IStTxtPara para, string runText, int ws ) : void
para IStTxtPara
runText string
ws int
return void

AddRunToMockedPara() public method

Adds a run of text to the specified paragraph
public AddRunToMockedPara ( IStTxtPara para, string runText, string runStyleName ) : void
para IStTxtPara
runText string
runStyleName string
return void

AddRunToMockedTrans() protected method

Adds a run of text to the specified translation
protected AddRunToMockedTrans ( ICmTranslation trans, int btWS, int runWS, string runText, string runStyleName ) : void
trans ICmTranslation The translation where the run of text will be appended.
btWS int The writing system of the back translation
runWS int The writing system of the run
runText string The run text.
runStyleName string Name of the run style.
return void

AddRunToMockedTrans() protected method

Adds a run of text to the specified translation
protected AddRunToMockedTrans ( ICmTranslation trans, int btWS, string runText, string runStyleName ) : void
trans ICmTranslation
btWS int
runText string
runStyleName string
return void

AddRunToSegmentFt() protected method

Adds a run to the free translation of the specified segment of the specified paragraph having the specified style in the default analysis writing system.
protected AddRunToSegmentFt ( IStTxtPara para, int iSeg, string freeTrans, string styleName ) : void
para IStTxtPara The paragraph.
iSeg int The index of the segment.
freeTrans string The text of the translation.
styleName string The name of the style.
return void

AddSegmentFt() protected static method

Adds a free translation to the specified segment of the specified paragraph for the specified writing systems.
protected static AddSegmentFt ( IStTxtPara para, int iSeg, string freeTrans ) : void
para IStTxtPara The paragraph.
iSeg int The index of the segment.
freeTrans string The text of the translation.
return void

AddStyle() public method

Create a new style on the specified style list.
public AddStyle ( IFdoOwningCollection styleList, string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, int userLevel, bool isBuiltIn ) : IStStyle
styleList IFdoOwningCollection The style list to add the style to
name string style name
context ContextValues style context
structure StructureValues style structure
function FunctionValues style function
isCharStyle bool true if character style, otherwise false
userLevel int User level
isBuiltIn bool true if style is a bult-in style
return IStStyle

AddTestStyle() public method

Create a new style and add it to the Language Project stylesheet.
public AddTestStyle ( string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, IFdoOwningCollection styleCollection ) : IStStyle
name string style name
context ContextValues style context
structure StructureValues style structure
function FunctionValues style function
isCharStyle bool true if character style, otherwise false
styleCollection IFdoOwningCollection The style collection.
return IStStyle

AddTestStyle() public method

Create a new style and add it to the Language Project stylesheet.
public AddTestStyle ( string name, ContextValues context, StructureValues structure, FunctionValues function, bool isCharStyle, int userLevel, IFdoOwningCollection styleCollection ) : IStStyle
name string style name
context ContextValues style context
structure StructureValues style structure
function FunctionValues style function
isCharStyle bool true if character style, otherwise false
userLevel int The user level.
styleCollection IFdoOwningCollection The style collection.
return IStStyle

AppendRunToBt() public method

Append a run of text to a back translation of a paragraph.
public AppendRunToBt ( IStTxtPara para, int ws, string runText ) : void
para IStTxtPara given paragraph
ws int given writing system for the back translation
runText string given text to append to back translation
return void

ChangeDefaultAnalWs() protected method

Change the default analysis writing system. (This removes any previous "current" analysis writing system(s) from the list.) This also ensures that the given WS is in the list of all analysis WSs.
protected ChangeDefaultAnalWs ( IWritingSystem ws ) : void
ws IWritingSystem the writing system to set as the default analysis WS
return void

CreateTestData() protected method

Creates the test data.
protected CreateTestData ( ) : void
return void

TestSetup() public method

Override to start an undoable UOW.
public TestSetup ( ) : void
return void

TestTearDown() public method

Override to end the undoable UOW, Undo everything, and 'commit', which will essentially clear out the Redo stack.
public TestTearDown ( ) : void
return void

UndoAll() protected method

End the undoable UOW and Undo everything.
protected UndoAll ( ) : void
return void