1515*
1616*/
1717
18+ using IBM . Watson . Discovery . v2 . Model ;
1819using Microsoft . VisualStudio . TestTools . UnitTesting ;
20+ using System . Collections . Generic ;
1921
2022namespace IBM . Watson . Discovery . v2 . IntegrationTests
2123{
@@ -24,11 +26,161 @@ public class DiscoveryIntegrationTests
2426 {
2527 private DiscoveryService service ;
2628 private string versionDate = "2019-11-20" ;
29+ private string projectId = "" ;
30+ private string collectionId ;
31+ private string queryId ;
2732
2833 [ TestInitialize ]
2934 public void Setup ( )
3035 {
3136 service = new DiscoveryService ( versionDate ) ;
3237 }
38+
39+ #region Collections
40+ [ TestMethod ]
41+ public void TestListCollections ( )
42+ {
43+ service . WithHeader ( "X-Watson-Test" , "1" ) ;
44+ var listCollectionResult = service . ListCollections (
45+ projectId : projectId
46+ ) ;
47+
48+ Assert . IsNotNull ( listCollectionResult . Result . Collections ) ;
49+ Assert . IsTrue ( listCollectionResult . Result . Collections . Count > 0 ) ;
50+ Assert . IsNotNull ( listCollectionResult . Result . Collections [ 0 ] . CollectionId ) ;
51+ Assert . IsNotNull ( listCollectionResult . Result . Collections [ 0 ] . Name ) ;
52+ }
53+ #endregion
54+
55+ #region Queries
56+ [ TestMethod ]
57+ public void TestQuery ( )
58+ {
59+ service . WithHeader ( "X-Watson-Test" , "1" ) ;
60+ string filter = "" ;
61+ string query = "text:IBM" ;
62+ string naturalLanguageQuery = "" ;
63+ string aggregation = "" ;
64+ long count = 5 ;
65+ List < string > _return = new List < string > ( ) { "" } ;
66+ long offset = 1 ;
67+ string sort = "" ;
68+ bool highlight = true ;
69+ bool spellingSuggestions = true ;
70+ QueryLargeTableResults tableResults = new QueryLargeTableResults ( )
71+ {
72+ Enabled = true ,
73+ Count = 3
74+ } ;
75+ QueryLargeSuggestedRefinements suggestedRefinements = new QueryLargeSuggestedRefinements ( )
76+ {
77+ Enabled = true ,
78+ Count = 3
79+ } ;
80+ QueryLargePassages passages = new QueryLargePassages ( )
81+ {
82+ Enabled = true ,
83+ PerDocument = true ,
84+ MaxPerDocument = 3 ,
85+ Fields = new List < string > ( )
86+ {
87+ ""
88+ } ,
89+ Count = 3 ,
90+ Characters = 100
91+ } ;
92+ var queryResult = service . Query (
93+ projectId : projectId ,
94+ collectionIds : new List < string > ( ) { collectionId } ,
95+ filter : filter ,
96+ query : query ,
97+ naturalLanguageQuery : naturalLanguageQuery ,
98+ aggregation : aggregation ,
99+ count : count ,
100+ _return : _return ,
101+ offset : offset ,
102+ sort : sort ,
103+ highlight : highlight ,
104+ spellingSuggestions : spellingSuggestions ,
105+ tableResults : tableResults ,
106+ suggestedRefinements : suggestedRefinements ,
107+ passages : passages
108+ ) ;
109+
110+ Assert . IsNotNull ( queryResult . Result ) ;
111+ }
112+
113+ [ TestMethod ]
114+ public void TestGetAutocompletion ( )
115+ {
116+ Assert . Fail ( ) ;
117+ }
118+
119+ [ TestMethod ]
120+ public void TestQueryNotices ( )
121+ {
122+ Assert . Fail ( ) ;
123+ }
124+
125+ [ TestMethod ]
126+ public void TestListFields ( )
127+ {
128+ Assert . Fail ( ) ;
129+ }
130+ #endregion
131+
132+ #region Component Settings
133+ [ TestMethod ]
134+ public void TestGetComponentSettings ( )
135+ {
136+ Assert . Fail ( ) ;
137+ }
138+ #endregion
139+
140+ #region Documents
141+ [ TestMethod ]
142+ public void TestAddDocument ( )
143+ {
144+ Assert . Fail ( ) ;
145+ }
146+
147+ [ TestMethod ]
148+ public void TestDeleteDocument ( )
149+ {
150+ Assert . Fail ( ) ;
151+ }
152+ #endregion
153+
154+ #region Training Data
155+ [ TestMethod ]
156+ public void TestListTrainingQueries ( )
157+ {
158+ Assert . Fail ( ) ;
159+ }
160+
161+ [ TestMethod ]
162+ public void TestDeleteTrainingQueries ( )
163+ {
164+ Assert . Fail ( ) ;
165+ }
166+
167+ [ TestMethod ]
168+ public void TestCreateTrainingQuery ( )
169+ {
170+ Assert . Fail ( ) ;
171+ }
172+
173+ [ TestMethod ]
174+ public void TestGetTrainingQuery ( )
175+ {
176+ Assert . Fail ( ) ;
177+ }
178+
179+ [ TestMethod ]
180+ public void TestUpdateTrainingQuery ( )
181+ {
182+ Assert . Fail ( ) ;
183+ }
184+ #endregion
33185 }
34186}
0 commit comments