File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
backend/FwLite/FwDataMiniLcmBridge.Tests/MiniLcmTests Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 11using FwDataMiniLcmBridge . Api ;
22using FwDataMiniLcmBridge . Tests . Fixtures ;
33using MiniLcm . Models ;
4+ using SIL . LCModel ;
45using SIL . LCModel . Infrastructure ;
56
67namespace FwDataMiniLcmBridge . Tests . MiniLcmTests ;
@@ -81,4 +82,31 @@ public async Task SetPartOfSpeech_WithNullMorphoSyntaxAnalysisRA_ToNull()
8182 retrievedEntry . Should ( ) . NotBeNull ( ) ;
8283 retrievedEntry ! . PartOfSpeechId . Should ( ) . BeNull ( ) ;
8384 }
85+
86+ [ Fact ]
87+ public async Task GetPartsOfSpeech_DoesNotReturnReversalIndexPos ( )
88+ {
89+ // Arrange
90+ var fwApi = ( FwDataMiniLcmApi ) BaseApi ;
91+ var reversalIndexRepository = fwApi . Cache . ServiceLocator . GetInstance < IReversalIndexRepository > ( ) ;
92+ var analysisWs = fwApi . Cache . DefaultAnalWs ;
93+
94+ var reversalPosGuid = Guid . NewGuid ( ) ;
95+ UndoableUnitOfWorkHelper . DoUsingNewOrCurrentUOW ( "Create Reversal Index POS" ,
96+ "Remove Reversal Index POS" ,
97+ fwApi . Cache . ServiceLocator . ActionHandler ,
98+ ( ) =>
99+ {
100+ var reversalIndex = reversalIndexRepository . FindOrCreateIndexForWs ( analysisWs ) ;
101+ var posFactory = fwApi . Cache . ServiceLocator . GetInstance < IPartOfSpeechFactory > ( ) ;
102+ var reversalPos = posFactory . Create ( reversalPosGuid , reversalIndex . PartsOfSpeechOA ) ;
103+ reversalPos . Name . set_String ( analysisWs , "Reversal Test POS" ) ;
104+ } ) ;
105+
106+ // Act
107+ var partsOfSpeech = await Api . GetPartsOfSpeech ( ) . ToArrayAsync ( ) ;
108+
109+ // Assert
110+ partsOfSpeech . Should ( ) . NotContain ( pos => pos . Id == reversalPosGuid ) ;
111+ }
84112}
You can’t perform that action at this time.
0 commit comments