@@ -97,6 +97,7 @@ public class ExampleAssistant : MonoBehaviour
9797 private bool _createEntityTested = false ;
9898 private bool _getEntityTested = false ;
9999 private bool _updateEntityTested = false ;
100+ private bool _listMentionsTested = false ;
100101 private bool _listValuesTested = false ;
101102 private bool _createValueTested = false ;
102103 private bool _getValueTested = false ;
@@ -189,8 +190,8 @@ private IEnumerator Examples()
189190 // Update Workspace
190191 UpdateWorkspace updateWorkspace = new UpdateWorkspace ( )
191192 {
192- Name = _createdWorkspaceName + "-updated " ,
193- Description = _createdWorkspaceDescription + "-updated " ,
193+ Name = _createdWorkspaceName + "Updated " ,
194+ Description = _createdWorkspaceDescription + "Updated " ,
194195 Language = _createdWorkspaceLanguage
195196 } ;
196197 _service . UpdateWorkspace ( OnUpdateWorkspace , OnFail , _createdWorkspaceId , updateWorkspace ) ;
@@ -259,8 +260,8 @@ private IEnumerator Examples()
259260 while ( ! _getIntentTested )
260261 yield return null ;
261262 // Update Intents
262- string updatedIntent = _createdIntent + "-updated " ;
263- string updatedIntentDescription = _createdIntentDescription + "-updated " ;
263+ string updatedIntent = _createdIntent + "Updated " ;
264+ string updatedIntentDescription = _createdIntentDescription + "Updated " ;
264265 UpdateIntent updateIntent = new UpdateIntent ( )
265266 {
266267 Intent = updatedIntent ,
@@ -287,7 +288,7 @@ private IEnumerator Examples()
287288 while ( ! _getExampleTested )
288289 yield return null ;
289290 // Update Examples
290- string updatedExample = _createdExample + "-updated " ;
291+ string updatedExample = _createdExample + "Updated " ;
291292 UpdateExample updateExample = new UpdateExample ( )
292293 {
293294 Text = updatedExample
@@ -314,8 +315,8 @@ private IEnumerator Examples()
314315 while ( ! _getEntityTested )
315316 yield return null ;
316317 // Update Entities
317- string updatedEntity = _createdEntity + "-updated " ;
318- string updatedEntityDescription = _createdEntityDescription + "-updated " ;
318+ string updatedEntity = _createdEntity + "Updated " ;
319+ string updatedEntityDescription = _createdEntityDescription + "Updated " ;
319320 UpdateEntity updateEntity = new UpdateEntity ( )
320321 {
321322 Entity = updatedEntity ,
@@ -325,6 +326,11 @@ private IEnumerator Examples()
325326 while ( ! _updateEntityTested )
326327 yield return null ;
327328
329+ // List Mentinos
330+ _service . ListMentions ( OnListMentions , OnFail , _createdWorkspaceId , updatedEntity ) ;
331+ while ( ! _listMentionsTested )
332+ yield return null ;
333+
328334 // List Values
329335 _service . ListValues ( OnListValues , OnFail , _createdWorkspaceId , updatedEntity ) ;
330336 while ( ! _listValuesTested )
@@ -342,7 +348,7 @@ private IEnumerator Examples()
342348 while ( ! _getValueTested )
343349 yield return null ;
344350 // Update Values
345- string updatedValue = _createdValue + "-updated " ;
351+ string updatedValue = _createdValue + "Updated " ;
346352 UpdateValue updateValue = new UpdateValue ( )
347353 {
348354 Value = updatedValue
@@ -368,7 +374,7 @@ private IEnumerator Examples()
368374 while ( ! _getSynonymTested )
369375 yield return null ;
370376 // Update Synonyms
371- string updatedSynonym = _createdSynonym + "-updated " ;
377+ string updatedSynonym = _createdSynonym + "Updated " ;
372378 UpdateSynonym updateSynonym = new UpdateSynonym ( )
373379 {
374380 Synonym = updatedSynonym
@@ -395,8 +401,8 @@ private IEnumerator Examples()
395401 while ( ! _getDialogNodeTested )
396402 yield return null ;
397403 // Update Dialog Nodes
398- string updatedDialogNodeName = _dialogNodeName + "_updated " ;
399- string updatedDialogNodeDescription = _dialogNodeDesc + "_updated " ;
404+ string updatedDialogNodeName = _dialogNodeName + "Updated " ;
405+ string updatedDialogNodeDescription = _dialogNodeDesc + "Updated " ;
400406 UpdateDialogNode updateDialogNode = new UpdateDialogNode ( )
401407 {
402408 DialogNode = updatedDialogNodeName ,
@@ -433,7 +439,7 @@ private IEnumerator Examples()
433439 while ( ! _getCounterexampleTested )
434440 yield return null ;
435441 // Update Counterexamples
436- string updatedCounterExampleText = _createdCounterExampleText + "-updated " ;
442+ string updatedCounterExampleText = _createdCounterExampleText + "Updated " ;
437443 UpdateCounterexample updateCounterExample = new UpdateCounterexample ( )
438444 {
439445 Text = updatedCounterExampleText
@@ -480,6 +486,12 @@ private IEnumerator Examples()
480486 yield break ;
481487 }
482488
489+ private void OnListMentions ( EntityMentionCollection response , Dictionary < string , object > customData )
490+ {
491+ Log . Debug ( "ExampleAssistant.OnListMentions()" , "Response: {0}" , customData [ "json" ] . ToString ( ) ) ;
492+ _listMentionsTested = true ;
493+ }
494+
483495 private void OnDeleteWorkspace ( object response , Dictionary < string , object > customData )
484496 {
485497 Log . Debug ( "ExampleAssistant.OnDeleteWorkspace()" , "Response: {0}" , customData [ "json" ] . ToString ( ) ) ;
@@ -769,6 +781,13 @@ private void OnCreateWorkspace(Workspace response, Dictionary<string, object> cu
769781 private void OnListWorkspaces ( WorkspaceCollection response , Dictionary < string , object > customData )
770782 {
771783 Log . Debug ( "ExampleAssistant.OnListWorkspaces()" , "Response: {0}" , customData [ "json" ] . ToString ( ) ) ;
784+
785+ foreach ( Workspace workspace in response . Workspaces )
786+ {
787+ if ( workspace . Name . Contains ( "unity" ) )
788+ _service . DeleteWorkspace ( OnDeleteWorkspace , OnFail , workspace . WorkspaceId ) ;
789+ }
790+
772791 _listWorkspacesTested = true ;
773792 }
774793
0 commit comments