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

Afficher le fichier Open project: sillsdev/FieldWorks

Méthodes publiques

Méthode Description
SetParaContents ( IStTxtPara para, string contents ) : void
SetString ( IMultiString target, int ws, string text ) : void
SetString ( IMultiUnicode target, int ws, string text ) : void
VerifyReconcilingAChange ( System.Action makeTheChange, string label ) : void

Helper method for several tests on this pattern: create an object that has the required kind of data; Save; make the change; make a set of newby/dirtball/deleted surrogates and Ids of the unsaved changes; Undo the change; pass the set of changes to the reconciler; verify that all expected objects are deleted; verify that all expected newbies exist; verify the current state of the newbies and dirtballs by checking that their XML dump is exactly what it was after the change. The calling test takes things as far as creating the initial state. This routine takes over there.

Private Methods

Méthode Description
AddSense ( ILexEntry entry, string gloss ) : ILexSense
GetEffectsOfChange ( System.Action makeTheChange, System.Action doAfterUow, List &newbySurrogates, List &dirtballSurrogates, List &gonerList ) : void

Get the effects of making the change (done by executing the "makeTheChange" action) in the form of lists of new, modified, and deleted objects. The additional action, doAfterUow, is 'done' after the UOW is complete, before the Undo.

GetEffectsOfChange ( System.Action makeTheChange, List &newbySurrogates, List &dirtballSurrogates, List &gonerList ) : void

Get the effects of making the change (done by executing the "makeTheChange" action) in the form of lists of new, modified, and deleted objects.

GetSurrogate ( ICmObject obj, ICmObjectSurrogateFactory cmoFactory ) : ICmObjectSurrogate
IsTimeNearlyEqual ( System.DateTime originalTime, System.DateTime newTime ) : bool

Not more than a ms off...rounding errors because we only store it to the MS in XML.

MakeBundle ( string wordform, ILexSense sense ) : IWfiMorphBundle
MakeEntry ( string lf, string gloss ) : ILexEntry

Copied from StringServicesTests (plus UOW); possibly best for each test set to have own utility functions?

ModifiedDifferentSenses_EarlierTime ( ) : void
ModifiedDifferentSenses_LaterTime ( ) : void
ReconcileCollectionChanges ( ) : void
ReconcileMakingEntryAndSense ( ) : void
ReconcileModifyingProperties ( ) : void
ReconcilingDeletingObjects ( ) : void
ReconcilingModifiedCustomProperties ( ) : void
ReconcilingMovingObjects ( ) : void
Save ( ) : void
VerifyOkToReconcileChanges ( ) : void
WaitForTimeToChange ( System.DateTime old ) : void

Busy-wait until we can be sure Now will be a (significantly) later time than the input. We record times in files to 1 ms, and compare +-3ms, so 5 is enough to ensure this.

Method Details

SetParaContents() public méthode

public SetParaContents ( IStTxtPara para, string contents ) : void
para IStTxtPara
contents string
Résultat void

SetString() public méthode

public SetString ( IMultiString target, int ws, string text ) : void
target IMultiString
ws int
text string
Résultat void

SetString() public méthode

public SetString ( IMultiUnicode target, int ws, string text ) : void
target IMultiUnicode
ws int
text string
Résultat void

VerifyReconcilingAChange() public méthode

Helper method for several tests on this pattern: create an object that has the required kind of data; Save; make the change; make a set of newby/dirtball/deleted surrogates and Ids of the unsaved changes; Undo the change; pass the set of changes to the reconciler; verify that all expected objects are deleted; verify that all expected newbies exist; verify the current state of the newbies and dirtballs by checking that their XML dump is exactly what it was after the change. The calling test takes things as far as creating the initial state. This routine takes over there.
public VerifyReconcilingAChange ( System.Action makeTheChange, string label ) : void
makeTheChange System.Action
label string
Résultat void