Skip to content

Commit 1445ded

Browse files
committed
refactor(Assistant V2): Rename Assistant tests to AssistantV1
1 parent 5a6f45e commit 1445ded

File tree

2 files changed

+50
-51
lines changed

2 files changed

+50
-51
lines changed

Examples/ServiceExamples/Scripts/ExampleAssistant.cs renamed to Examples/ServiceExamples/Scripts/ExampleAssistantV1.cs

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
using IBM.Watson.DeveloperCloud.Logging;
2121
using IBM.Watson.DeveloperCloud.Services.Assistant.v1;
2222
using IBM.Watson.DeveloperCloud.Utilities;
23-
using System;
2423
using System.Collections;
2524
using System.Collections.Generic;
2625
using UnityEngine;
2726

28-
public class ExampleAssistant : MonoBehaviour
27+
public class ExampleAssistantV1 : MonoBehaviour
2928
{
3029
#region PLEASE SET THESE VARIABLES IN THE INSPECTOR
3130
[Space(10)]
@@ -481,248 +480,248 @@ private IEnumerator Examples()
481480
while (!_deleteWorkspaceTested)
482481
yield return null;
483482

484-
Log.Debug("TestAssistant.RunTest()", "Assistant examples complete.");
483+
Log.Debug("ExampleAssistantV1.RunTest()", "Assistant examples complete.");
485484

486485
yield break;
487486
}
488487

489488
private void OnListMentions(EntityMentionCollection response, Dictionary<string, object> customData)
490489
{
491-
Log.Debug("ExampleAssistant.OnListMentions()", "Response: {0}", customData["json"].ToString());
490+
Log.Debug("ExampleAssistantV1.OnListMentions()", "Response: {0}", customData["json"].ToString());
492491
_listMentionsTested = true;
493492
}
494493

495494
private void OnDeleteWorkspace(object response, Dictionary<string, object> customData)
496495
{
497-
Log.Debug("ExampleAssistant.OnDeleteWorkspace()", "Response: {0}", customData["json"].ToString());
496+
Log.Debug("ExampleAssistantV1.OnDeleteWorkspace()", "Response: {0}", customData["json"].ToString());
498497
_deleteWorkspaceTested = true;
499498
}
500499

501500
private void OnDeleteIntent(object response, Dictionary<string, object> customData)
502501
{
503-
Log.Debug("ExampleAssistant.OnDeleteIntent()", "Response: {0}", customData["json"].ToString());
502+
Log.Debug("ExampleAssistantV1.OnDeleteIntent()", "Response: {0}", customData["json"].ToString());
504503
_deleteIntentTested = true;
505504
}
506505

507506
private void OnDeleteExample(object response, Dictionary<string, object> customData)
508507
{
509-
Log.Debug("ExampleAssistant.OnDeleteExample()", "Response: {0}", customData["json"].ToString());
508+
Log.Debug("ExampleAssistantV1.OnDeleteExample()", "Response: {0}", customData["json"].ToString());
510509
_deleteExampleTested = true;
511510
}
512511

513512
private void OnDeleteEntity(object response, Dictionary<string, object> customData)
514513
{
515-
Log.Debug("ExampleAssistant.OnDeleteEntity()", "Response: {0}", customData["json"].ToString());
514+
Log.Debug("ExampleAssistantV1.OnDeleteEntity()", "Response: {0}", customData["json"].ToString());
516515
_deleteEntityTested = true;
517516
}
518517

519518
private void OnDeleteValue(object response, Dictionary<string, object> customData)
520519
{
521-
Log.Debug("ExampleAssistant.OnDeleteValue()", "Response: {0}", customData["json"].ToString());
520+
Log.Debug("ExampleAssistantV1.OnDeleteValue()", "Response: {0}", customData["json"].ToString());
522521
_deleteValueTested = true;
523522
}
524523

525524
private void OnDeleteSynonym(object response, Dictionary<string, object> customData)
526525
{
527-
Log.Debug("ExampleAssistant.OnDeleteSynonym()", "Response: {0}", customData["json"].ToString());
526+
Log.Debug("ExampleAssistantV1.OnDeleteSynonym()", "Response: {0}", customData["json"].ToString());
528527
_deleteSynonymTested = true;
529528
}
530529

531530
private void OnDeleteDialogNode(object response, Dictionary<string, object> customData)
532531
{
533-
Log.Debug("ExampleAssistant.OnDeleteDialogNode()", "Response: {0}", customData["json"].ToString());
532+
Log.Debug("ExampleAssistantV1.OnDeleteDialogNode()", "Response: {0}", customData["json"].ToString());
534533
_deleteDialogNodeTested = true;
535534
}
536535

537536
private void OnDeleteCounterexample(object response, Dictionary<string, object> customData)
538537
{
539-
Log.Debug("ExampleAssistant.OnDeleteCounterexample()", "Response: {0}", customData["json"].ToString());
538+
Log.Debug("ExampleAssistantV1.OnDeleteCounterexample()", "Response: {0}", customData["json"].ToString());
540539
_deleteCounterexampleTested = true;
541540
}
542541

543542
private void OnUpdateCounterexample(Counterexample response, Dictionary<string, object> customData)
544543
{
545-
Log.Debug("ExampleAssistant.OnUpdateCounterexample()", "Response: {0}", customData["json"].ToString());
544+
Log.Debug("ExampleAssistantV1.OnUpdateCounterexample()", "Response: {0}", customData["json"].ToString());
546545
_updateCounterexampleTested = true;
547546
}
548547

549548
private void OnGetCounterexample(Counterexample response, Dictionary<string, object> customData)
550549
{
551-
Log.Debug("ExampleAssistant.OnGetCounterexample()", "Response: {0}", customData["json"].ToString());
550+
Log.Debug("ExampleAssistantV1.OnGetCounterexample()", "Response: {0}", customData["json"].ToString());
552551
_getCounterexampleTested = true;
553552
}
554553

555554
private void OnCreateCounterexample(Counterexample response, Dictionary<string, object> customData)
556555
{
557-
Log.Debug("ExampleAssistant.OnCreateCounterexample()", "Response: {0}", customData["json"].ToString());
556+
Log.Debug("ExampleAssistantV1.OnCreateCounterexample()", "Response: {0}", customData["json"].ToString());
558557
_createCounterexampleTested = true;
559558
}
560559

561560
private void OnListCounterexamples(CounterexampleCollection response, Dictionary<string, object> customData)
562561
{
563-
Log.Debug("ExampleAssistant.OnListCounterexamples()", "Response: {0}", customData["json"].ToString());
562+
Log.Debug("ExampleAssistantV1.OnListCounterexamples()", "Response: {0}", customData["json"].ToString());
564563
_listCounterexamplesTested = true;
565564
}
566565

567566
private void OnListAllLogs(LogCollection response, Dictionary<string, object> customData)
568567
{
569-
Log.Debug("ExampleAssistant.OnListAllLogs()", "Response: {0}", customData["json"].ToString());
568+
Log.Debug("ExampleAssistantV1.OnListAllLogs()", "Response: {0}", customData["json"].ToString());
570569
_listAllLogsTested = true;
571570
}
572571

573572
private void OnListLogs(LogCollection response, Dictionary<string, object> customData)
574573
{
575-
Log.Debug("ExampleAssistant.OnListLogs()", "Response: {0}", customData["json"].ToString());
574+
Log.Debug("ExampleAssistantV1.OnListLogs()", "Response: {0}", customData["json"].ToString());
576575
_listLogsInWorkspaceTested = true;
577576
}
578577

579578
private void OnUpdateDialogNode(DialogNode response, Dictionary<string, object> customData)
580579
{
581-
Log.Debug("ExampleAssistant.OnUpdateDialogNode()", "Response: {0}", customData["json"].ToString());
580+
Log.Debug("ExampleAssistantV1.OnUpdateDialogNode()", "Response: {0}", customData["json"].ToString());
582581
_updateDialogNodeTested = true;
583582
}
584583

585584
private void OnGetDialogNode(DialogNode response, Dictionary<string, object> customData)
586585
{
587-
Log.Debug("ExampleAssistant.OnGetDialogNode()", "Response: {0}", customData["json"].ToString());
586+
Log.Debug("ExampleAssistantV1.OnGetDialogNode()", "Response: {0}", customData["json"].ToString());
588587
_getDialogNodeTested = true;
589588
}
590589

591590
private void OnCreateDialogNode(DialogNode response, Dictionary<string, object> customData)
592591
{
593-
Log.Debug("ExampleAssistant.OnCreateDialogNode()", "Response: {0}", customData["json"].ToString());
592+
Log.Debug("ExampleAssistantV1.OnCreateDialogNode()", "Response: {0}", customData["json"].ToString());
594593
_createDialogNodeTested = true;
595594
}
596595

597596
private void OnListDialogNodes(DialogNodeCollection response, Dictionary<string, object> customData)
598597
{
599-
Log.Debug("ExampleAssistant.OnListDialogNodes()", "Response: {0}", customData["json"].ToString());
598+
Log.Debug("ExampleAssistantV1.OnListDialogNodes()", "Response: {0}", customData["json"].ToString());
600599
_listDialogNodesTested = true;
601600
}
602601

603602
private void OnUpdateSynonym(Synonym response, Dictionary<string, object> customData)
604603
{
605-
Log.Debug("ExampleAssistant.OnUpdateSynonym()", "Response: {0}", customData["json"].ToString());
604+
Log.Debug("ExampleAssistantV1.OnUpdateSynonym()", "Response: {0}", customData["json"].ToString());
606605
_updateSynonymTested = true;
607606
}
608607

609608
private void OnGetSynonym(Synonym response, Dictionary<string, object> customData)
610609
{
611-
Log.Debug("ExampleAssistant.OnGetSynonym()", "Response: {0}", customData["json"].ToString());
610+
Log.Debug("ExampleAssistantV1.OnGetSynonym()", "Response: {0}", customData["json"].ToString());
612611
_getSynonymTested = true;
613612
}
614613

615614
private void OnCreateSynonym(Synonym response, Dictionary<string, object> customData)
616615
{
617-
Log.Debug("ExampleAssistant.OnCreateSynonym()", "Response: {0}", customData["json"].ToString());
616+
Log.Debug("ExampleAssistantV1.OnCreateSynonym()", "Response: {0}", customData["json"].ToString());
618617
_createSynonymTested = true;
619618
}
620619

621620
private void OnListSynonyms(SynonymCollection response, Dictionary<string, object> customData)
622621
{
623-
Log.Debug("ExampleAssistant.OnListSynonyms()", "Response: {0}", customData["json"].ToString());
622+
Log.Debug("ExampleAssistantV1.OnListSynonyms()", "Response: {0}", customData["json"].ToString());
624623
_listSynonymsTested = true;
625624
}
626625

627626
private void OnUpdateValue(Value response, Dictionary<string, object> customData)
628627
{
629-
Log.Debug("ExampleAssistant.OnUpdateValue()", "Response: {0}", customData["json"].ToString());
628+
Log.Debug("ExampleAssistantV1.OnUpdateValue()", "Response: {0}", customData["json"].ToString());
630629
_updateValueTested = true;
631630
}
632631

633632
private void OnGetValue(ValueExport response, Dictionary<string, object> customData)
634633
{
635-
Log.Debug("ExampleAssistant.OnGetValue()", "Response: {0}", customData["json"].ToString());
634+
Log.Debug("ExampleAssistantV1.OnGetValue()", "Response: {0}", customData["json"].ToString());
636635
_getValueTested = true;
637636
}
638637

639638
private void OnCreateValue(Value response, Dictionary<string, object> customData)
640639
{
641-
Log.Debug("ExampleAssistant.OnCreateValue()", "Response: {0}", customData["json"].ToString());
640+
Log.Debug("ExampleAssistantV1.OnCreateValue()", "Response: {0}", customData["json"].ToString());
642641
_createValueTested = true;
643642
}
644643

645644
private void OnListValues(ValueCollection response, Dictionary<string, object> customData)
646645
{
647-
Log.Debug("ExampleAssistant.OnListValues()", "Response: {0}", customData["json"].ToString());
646+
Log.Debug("ExampleAssistantV1.OnListValues()", "Response: {0}", customData["json"].ToString());
648647
_listValuesTested = true;
649648
}
650649

651650
private void OnUpdateEntity(Entity response, Dictionary<string, object> customData)
652651
{
653-
Log.Debug("ExampleAssistant.OnUpdateEntity()", "Response: {0}", customData["json"].ToString());
652+
Log.Debug("ExampleAssistantV1.OnUpdateEntity()", "Response: {0}", customData["json"].ToString());
654653
_updateEntityTested = true;
655654
}
656655

657656
private void OnGetEntity(EntityExport response, Dictionary<string, object> customData)
658657
{
659-
Log.Debug("ExampleAssistant.OnGetEntity()", "Response: {0}", customData["json"].ToString());
658+
Log.Debug("ExampleAssistantV1.OnGetEntity()", "Response: {0}", customData["json"].ToString());
660659
_getEntityTested = true;
661660
}
662661

663662
private void OnCreateEntity(Entity response, Dictionary<string, object> customData)
664663
{
665-
Log.Debug("ExampleAssistant.OnCreateEntity()", "Response: {0}", customData["json"].ToString());
664+
Log.Debug("ExampleAssistantV1.OnCreateEntity()", "Response: {0}", customData["json"].ToString());
666665
_createEntityTested = true;
667666
}
668667

669668
private void OnListEntities(EntityCollection response, Dictionary<string, object> customData)
670669
{
671-
Log.Debug("ExampleAssistant.OnListEntities()", "Response: {0}", customData["json"].ToString());
670+
Log.Debug("ExampleAssistantV1.OnListEntities()", "Response: {0}", customData["json"].ToString());
672671
_listEntitiesTested = true;
673672
}
674673

675674
private void OnUpdateExample(Example response, Dictionary<string, object> customData)
676675
{
677-
Log.Debug("ExampleAssistant.OnUpdateExample()", "Response: {0}", customData["json"].ToString());
676+
Log.Debug("ExampleAssistantV1.OnUpdateExample()", "Response: {0}", customData["json"].ToString());
678677
_updateExampleTested = true;
679678
}
680679

681680
private void OnGetExample(Example response, Dictionary<string, object> customData)
682681
{
683-
Log.Debug("ExampleAssistant.OnGetExample()", "Response: {0}", customData["json"].ToString());
682+
Log.Debug("ExampleAssistantV1.OnGetExample()", "Response: {0}", customData["json"].ToString());
684683
_getExampleTested = true;
685684
}
686685

687686
private void OnCreateExample(Example response, Dictionary<string, object> customData)
688687
{
689-
Log.Debug("ExampleAssistant.OnCreateExample()", "Response: {0}", customData["json"].ToString());
688+
Log.Debug("ExampleAssistantV1.OnCreateExample()", "Response: {0}", customData["json"].ToString());
690689
_createExampleTested = true;
691690
}
692691

693692
private void OnListExamples(ExampleCollection response, Dictionary<string, object> customData)
694693
{
695-
Log.Debug("ExampleAssistant.OnListExamples()", "Response: {0}", customData["json"].ToString());
694+
Log.Debug("ExampleAssistantV1.OnListExamples()", "Response: {0}", customData["json"].ToString());
696695
_listExamplesTested = true;
697696
}
698697

699698
private void OnUpdateIntent(Intent response, Dictionary<string, object> customData)
700699
{
701-
Log.Debug("ExampleAssistant.OnUpdateIntent()", "Response: {0}", customData["json"].ToString());
700+
Log.Debug("ExampleAssistantV1.OnUpdateIntent()", "Response: {0}", customData["json"].ToString());
702701
_updateIntentTested = true;
703702
}
704703

705704
private void OnGetIntent(IntentExport response, Dictionary<string, object> customData)
706705
{
707-
Log.Debug("ExampleAssistant.OnGetIntent()", "Response: {0}", customData["json"].ToString());
706+
Log.Debug("ExampleAssistantV1.OnGetIntent()", "Response: {0}", customData["json"].ToString());
708707
_getIntentTested = true;
709708
}
710709

711710
private void OnCreateIntent(Intent response, Dictionary<string, object> customData)
712711
{
713-
Log.Debug("ExampleAssistant.OnCreateIntent()", "Response: {0}", customData["json"].ToString());
712+
Log.Debug("ExampleAssistantV1.OnCreateIntent()", "Response: {0}", customData["json"].ToString());
714713
_createIntentTested = true;
715714
}
716715

717716
private void OnListIntents(IntentCollection response, Dictionary<string, object> customData)
718717
{
719-
Log.Debug("ExampleAssistant.OnListIntents()", "Response: {0}", customData["json"].ToString());
718+
Log.Debug("ExampleAssistantV1.OnListIntents()", "Response: {0}", customData["json"].ToString());
720719
_listIntentsTested = true;
721720
}
722721

723722
private void OnMessage(object response, Dictionary<string, object> customData)
724723
{
725-
Log.Debug("ExampleAssistant.OnMessage()", "Response: {0}", customData["json"].ToString());
724+
Log.Debug("ExampleAssistantV1.OnMessage()", "Response: {0}", customData["json"].ToString());
726725

727726
// Convert resp to fsdata
728727
fsData fsdata = null;
@@ -744,7 +743,7 @@ private void OnMessage(object response, Dictionary<string, object> customData)
744743
if (_tempContext != null)
745744
_context = _tempContext as Dictionary<string, object>;
746745
else
747-
Log.Debug("ExampleAssistant.OnMessage()", "Failed to get context");
746+
Log.Debug("ExampleAssistantV1.OnMessage()", "Failed to get context");
748747

749748
// Get intent
750749
object tempIntentsObj = null;
@@ -754,33 +753,33 @@ private void OnMessage(object response, Dictionary<string, object> customData)
754753
(tempIntentObj as Dictionary<string, object>).TryGetValue("intent", out tempIntent);
755754
string intent = tempIntent.ToString();
756755

757-
Log.Debug("ExampleAssistant.OnMessage()", "intent: {0}", intent);
756+
Log.Debug("ExampleAssistantV1.OnMessage()", "intent: {0}", intent);
758757

759758
_messageTested = true;
760759
}
761760

762761
private void OnUpdateWorkspace(Workspace response, Dictionary<string, object> customData)
763762
{
764-
Log.Debug("ExampleAssistant.OnUpdateWorkspace()", "Response: {0}", customData["json"].ToString());
763+
Log.Debug("ExampleAssistantV1.OnUpdateWorkspace()", "Response: {0}", customData["json"].ToString());
765764
_updateWorkspaceTested = true;
766765
}
767766

768767
private void OnGetWorkspace(WorkspaceExport response, Dictionary<string, object> customData)
769768
{
770-
Log.Debug("ExampleAssistant.OnGetWorkspace()", "Response: {0}", customData["json"].ToString());
769+
Log.Debug("ExampleAssistantV1.OnGetWorkspace()", "Response: {0}", customData["json"].ToString());
771770
_getWorkspaceTested = true;
772771
}
773772

774773
private void OnCreateWorkspace(Workspace response, Dictionary<string, object> customData)
775774
{
776-
Log.Debug("ExampleAssistant.OnCreateWorkspace()", "Response: {0}", customData["json"].ToString());
775+
Log.Debug("ExampleAssistantV1.OnCreateWorkspace()", "Response: {0}", customData["json"].ToString());
777776
_createdWorkspaceId = response.WorkspaceId;
778777
_createWorkspaceTested = true;
779778
}
780779

781780
private void OnListWorkspaces(WorkspaceCollection response, Dictionary<string, object> customData)
782781
{
783-
Log.Debug("ExampleAssistant.OnListWorkspaces()", "Response: {0}", customData["json"].ToString());
782+
Log.Debug("ExampleAssistantV1.OnListWorkspaces()", "Response: {0}", customData["json"].ToString());
784783

785784
foreach(Workspace workspace in response.Workspaces)
786785
{
@@ -793,7 +792,7 @@ private void OnListWorkspaces(WorkspaceCollection response, Dictionary<string, o
793792

794793
private void OnFail(RESTConnector.Error error, Dictionary<string, object> customData)
795794
{
796-
Log.Debug("ExampleAssistant.OnFail()", "Response: {0}", customData["json"].ToString());
797-
Log.Error("TestAssistant.OnFail()", "Error received: {0}", error.ToString());
795+
Log.Debug("ExampleAssistantV1.OnFail()", "Response: {0}", customData["json"].ToString());
796+
Log.Error("ExampleAssistantV1.OnFail()", "Error received: {0}", error.ToString());
798797
}
799798
}

Examples/ServiceExamples/Scripts/ExampleAssistant.cs.meta renamed to Examples/ServiceExamples/Scripts/ExampleAssistantV1.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)