@@ -2,8 +2,14 @@ import org.scalatest.path.FunSpec
22import scala .concurrent .Await
33import scala .concurrent .ExecutionContext .Implicits .global
44import codecheck .github .models .SortDirection
5- import codecheck .github .models .SearchInput
6- import codecheck .github .models .SearchSort
5+ import codecheck .github .models .SearchRepositoryInput
6+ import codecheck .github .models .SearchCodeInput
7+ import codecheck .github .models .SearchIssueInput
8+ import codecheck .github .models .SearchUserInput
9+ import codecheck .github .models .SearchRepositorySort
10+ import codecheck .github .models .SearchCodeSort
11+ import codecheck .github .models .SearchIssueSort
12+ import codecheck .github .models .SearchUserSort
713import codecheck .github .models .SearchRepositoryResult
814import codecheck .github .models .SearchCodeResult
915import codecheck .github .models .searchCodeItems
@@ -17,7 +23,7 @@ class SearchOpSpec extends FunSpec
1723 it(" with valid SearchInput should succeed" ) {
1824 var q = " tetris language:assembly"
1925 val q1 = q.trim.replaceAll(" " ," +" );
20- val input = SearchInput (q1,sort= Some (SearchSort .stars),order= SortDirection .desc)
26+ val input = SearchRepositoryInput (q1,sort= Some (SearchRepositorySort .stars),order= SortDirection .desc)
2127 val res = Await .result(api.searchRepositories(input), TIMEOUT )
2228 assert(res.total_count >= 1 )
2329 assert(res.items(0 ).id >= 1 )
@@ -31,7 +37,7 @@ class SearchOpSpec extends FunSpec
3137 it(" with valid changed query(q) SearchInput should succeed" ) {
3238 var q = " jquery in:name,description"
3339 val q1 = q.trim.replaceAll(" " ," +" );
34- val input = SearchInput (q1,sort= Some (SearchSort .stars),order= SortDirection .desc)
40+ val input = SearchRepositoryInput (q1,sort= Some (SearchRepositorySort .stars),order= SortDirection .desc)
3541 val res = Await .result(api.searchRepositories(input), TIMEOUT )
3642 assert(res.total_count >= 1 )
3743 assert(res.items(0 ).id >= 1 )
@@ -45,7 +51,7 @@ class SearchOpSpec extends FunSpec
4551 it(" with valid SearchInput q,no SortOrder should succeed" ) {
4652 var q = " addClass in:file language:js repo:jquery/jquery"
4753 val q1 = q.trim.replaceAll(" " ," +" );
48- val input = SearchInput (q1,sort= None ,order= SortDirection .desc)
54+ val input = SearchCodeInput (q1,sort= None ,order= SortDirection .desc)
4955 val res = Await .result(api.searchCode(input), TIMEOUT )
5056 assert(res.total_count >= 1 )
5157 assert(res.items(0 ).Repo .id >= 1 )
@@ -58,7 +64,7 @@ class SearchOpSpec extends FunSpec
5864 it(" with valid SearchInput it should succeed" ) {
5965 var q = " function size:10000 language:python"
6066 val q1 = q.trim.replaceAll(" " ," +" );
61- val input = SearchInput (q1,sort= Some (SearchSort .indexed),order= SortDirection .desc)
67+ val input = SearchCodeInput (q1,sort= Some (SearchCodeSort .indexed),order= SortDirection .desc)
6268 try {
6369 val res = Await .result(api.searchCode(input), TIMEOUT )
6470 } catch {
@@ -72,7 +78,7 @@ class SearchOpSpec extends FunSpec
7278 it(" with valid SearchInput should succeed" ) {
7379 var q = " windows label:bug language:python state:open"
7480 val q1 = q.trim.replaceAll(" " ," +" );
75- val input = SearchInput (q1,sort= Some (SearchSort .created),order= SortDirection .desc)
81+ val input = SearchIssueInput (q1,sort= Some (SearchIssueSort .created),order= SortDirection .desc)
7682 val res = Await .result(api.searchIssues(input), TIMEOUT )
7783 assert(res.total_count >= 1 )
7884 assert(res.items(0 ).labels(0 ).name == " bug" )
@@ -85,7 +91,7 @@ class SearchOpSpec extends FunSpec
8591 var q = " tom repos:>42 followers:>1000"
8692 q = q.trim.replaceAll(" " ," +" )
8793 val q1 = q.replaceAll(" >" ," %3E" )
88- val input = SearchInput (q1,sort= None ,order= SortDirection .desc)
94+ val input = SearchUserInput (q1,sort= None ,order= SortDirection .desc)
8995 val res = Await .result(api.searchUser(input), TIMEOUT )
9096 assert(res.total_count >= 0 )
9197 assert(res.items(0 ).login.length >= 0 )
0 commit comments